To report an injustice committed to you to another person is not gheebah. This is not therefore condemnable. I have come across the following list of acts which apparently seem to be gheebah but are allowable, adopted from Imam Ghazali's Ihya al-Uloom. He writes:
Cases in which ghibah is permissible
- Injustice. One who has suffered injustice is entitled to mention the one who has committed injustice to someone who is capable of restoring his rights to him, such as a legitimate Muslim ruler or judge.
- Seeking help to change an evil, or to reform the wrongdoer. If the intention in the ghibah is not to change the wrong, then it is forbidden to relate it.
- Asking for a fatwa. A person may say, 'My father/brother/wife has done such-and-such to me. What can I do about it?
On the authority of `A'ishah: Hind, the wife of Abu Sufyan, said to the Prophet (may Allah bless him and grant him peace), "Abu Sufyan is a miserly man, and he is not giving me what would suffice me and my child, unless I take from him without his knowing." He said, "Take what suffices you and your child according to common usage." [Bukhari, Muslim]
However, it is more precautionary to avoid mention of names, for example by asking instead, "What is the verdict regarding a person who has done such-and-such?"
- Warning, such as warning a prospective buyer that the merchant is a swindler, or warning a student that his prospective teacher is an innovator or a deviant. Also, revealing the faults of weak narrators and forgers of hadith, and giving someone a candid appraisal of a person whom the former is thinking of marrying.
On the authority of Fatimah bint Qays: she said, "I came to the Prophet (may Allah bless him and grant him peace) and told him, "Abu Jahm and Mu`awiyah have [both] proposed to me." He said, "As for Mu`awiyah, he is a poor man with no money, and as for Abu Jahm, his stick never leaves his shoulder." [Bukhari, Muslim, Malik]
- If someone is commonly known by a nickname, although if there is some alternative way to refer to him, it is preferable.
- Someone who sins openly, and has no qualms about his sins being mentioned. However, it is not permissible to mention any of his secret sins.
"There can be no backbiting of one who casts off the mantle of modesty." [Suyuti, Al-Jami` As-Saghir, 2/519, from Bayhaqi.]