The Messenger of Allah ﷺ used to say, "Two practices among people amount to disbelief: wailing over the dead and attacking lineage."
حدثنا أسود أخبرنا أبو بكر عن الأعمش عن أبي صالح
كان رسول الله ﷺ يقول اثنان هما كفر النياحة والطعن في النسب
No references are available.
Its isnad is sahih. Muslim narrated something similar in 1/82, no. 67, in the Book of Faith, in the chapter on applying the term "disbelief" to disparaging lineage, and Tirmidhi in 3/316, no. 1001, and graded it hasan, and Ibn Abu Shayba in 3/390, in the Book of Funerals, in the chapter on wailing.