Fungus? Yes! Part of the mold family? Well, it's sort of the other way around, because mold is actually part of the fungus family. But you have bigger things to worry about than whether the chicken came before the egg!
Those mushrooms are wood-damaging fungi, a sign that Mother Nature's army of wood-destroying organisms is hard at work attacking your roof structure. Not good! The solution has a twofold approach:
1. Fix the leak. Wood-damaging fungi can only survive when the moisture content goes above 25%, so you first need to fix the leaks that are creating the moisture. If you do, these organisms will switch off and go dormant.
2. Ventilate, ventilate, ventilate. Most attics don't have enough ventilation. To get yours up to speed, read my post, "Drafty Attics are Good."
Small areas of wood-damaging fungus can be cleaned up with a solution of one third bleach and two thirds water. Be very careful when applying this bleach. You'll need to wear safety glasses, gloves and old clothes, and work cautiously since attics can be unfamiliar territory. For larger areas, you'll need to contact a pro. The key here is fixing those leaks. Once the leaks are gone and the humidity goes down, there will be no more fungus among us!
For more information on dealing with wood-damaging fungi and other members of the mold family, read books by indoor air quality expert Jeff May including My House is Killing Me and the Mold Survival Guide, all published by Johns Hopkins University Press. You'll also find great tips in the Mold Resource Guide on MoneyPit.com.