Masturbating in the state of ihraam

Q: A few years ago, I went for Hajj. May Allah Ta'ala forgive me, at that time (I can't remember if it was before or after Arafaat), I committed the terrible sin of masturbation. May Allah Ta'ala forgive me. What is the penalty for this? Also, does that act break ghusl? I doubt I made a ghusl after I committed that act. May Allah Ta'ala forgive me.