I have a circular region of what appears to be friction dermatitis around the foreskin just above the level where the glans sits on the shaft. I have never been able to retract my foreskin further than to a lumen of 13mm, but I understand that is a consequence of my adolescent lateness and gentleness in masturbating, and I'm not worried by that; however, I can't retract it even nearly as much, and when my penis becomes erect, the distension is painful. I would be surprised if it were an STI, although it is remotely possible; I haven't had sex for a long while, and then the penetrative element was protected (note I am homosexual and have always been the passive partner "bottom").