It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "The religion is sincere goodwill (nasihah)." The Companions asked: "For whom?" He (peace and blessings be upon him) said: "For the Book of Allah, the Mighty and Majestic, for His Prophet (peace and blessings be upon him), and for the leaders (rulers) of the Muslims."
Muhammad bin Muslim is al-Ta'ifi; the reports from Yahya bin Ma'in (may Allah have mercy on him) about him differ: in one report he declared him thiqah (trustworthy) and in another he declared him da'if (weak). Imam Muslim (may Allah have mercy on him) narrated from him.
This hadith has a supporting narration (shahid) in Sahih Muslim through the narration of Sayyiduna Tamim al-Dari (may Allah be pleased with him).
Imam Ahmad (may Allah have mercy on him) narrated this hadith from Zayd bin al-Hubab, from Abd al-Rahman bin Thawban, who said: I heard Amr bin Dinar (may Allah have mercy on him) say: "The one who heard it from Sayyiduna Ibn Abbas (may Allah be pleased with them both) informed me"; in this narration there is evidence that Amr did not hear this hadith directly from Sayyiduna Ibn Abbas (may Allah be pleased with them both). And Allah knows best.