Compromised flashing is a common roof problem. Flashing needs to be properly sealed to protect against water intrusion. It also needs to remain nailed in place and even if that is all squared away, the metal can rust or crack. One way to verify that the culprit is the chimney flashing is by running a low pressure hose around the chimney and roof intersection and check for water inside. This can be done with two people — one operating the hose and the other in the attic, with both peoples using cell phones and walkie-talkies. If you see any water inside, you need to get the flashing repaired. As always, exercise extreme caution when on a ladder and on your roof.