Wall to Roof Connection Leaks

The siding below has several deteriorated where it meets the extension roof. The wood siding has to be painted or stained regularly including its bottom edge so it will not absorb water. There should be a 1″ gap between the bottom of the siding and the roof. There should also be metal step flashing coming from behind the siding.