Vent pipes on wood and asphalt roofs are usually flashed using a pre-made metal pan with a rubber boot. Order the boot to match the outside diameter of the vent pipe, and install it as shown below, interwoven with the roof shingles. For slate and tile roofs, a malleable lead jacket might last longer than your average aluminum and rubber vent boot.

Vent pipes are sealed with a neoprene boot and a metal (often aluminum) base plate that’s woven into the roof shingles.
Vent pipes are sealed with a neoprene boot and a metal (often aluminum) base plate that’s woven into the roof shingles.

For more on roof flashing, visit the JLC Field Guide