Of course, as I remember it, it was fear of Dahmer, rather than punishment, that prompted the attack.
I think another inmate killed Dahmer by repeatedly slamming his head against a toilet, if I remember right.
Dahmer was cleaning a bathroom next to a gym with a guy named Scarver. Scarver took an iron rod from an exercise machine and crushed his skull. Scarver was fully loony and didn't fear Dahmer or much of anything.
I think Dahmer may have wanted to die. He turned down protective custody and went in with the general pop. A guy tried to cut his throat but he got away with just some cuts. Then a paranoid inmate named Scarver (who claimed to be the "son of god") bashed in Dahmer's skull with an iron bar from an exercise machine. He also killed the third guy on that work detail. At least, that's the story I read. Dahmer was in his early 30s and looking at a mandatory 1,000 years in the tank.