During the Cold War, it had to overfly Russian airspace to be able to see far enough. They were within their rights to shoot at unauthorized aircraft in their airspace.
However, it could see a lot higher percentage of Iran without overflying, and Iran can’t legally shoot at something in international airspace