The best known version, transmitted from the companion Abdullah ibn Mas'ud and recorded in Sunan Abi Dawud, has Muhammad saying that even if only one day remained before the end of the world, God would lengthen that day until a man of his own family, sharing his name, arose to fill the earth with justice as it had been filled with oppression. Related versions appear across the other Sunan collections and in some recensions of other compilations, but the report is notably absent from Sahih al-Bukhari and Sahih Muslim, the two collections Sunni scholarship treats as most rigorously verified.
The chain of transmission behind the Abu Dawud version has drawn sustained criticism. Later hadith critics flagged several of its narrators: Abu Dawud himself passed over one transmitter, Harun, without comment, a silence the discipline often reads as a quiet mark of doubt; another, Umar ibn Abi Qays, is noted in the biographical literature for errors in his narrations; and a further narrator, Abu Ishaq, is documented to have confused his sources late in life, with this particular chain showing signs of exactly that kind of break.
Ibn Khaldun surveyed the whole body of Mahdi hadiths in the Muqaddimah, in a chapter written partly to address Mahdist claimants active in his own fourteenth century North Africa, and concluded that most of the transmission chains supporting them were weak. He did not conclude that the underlying belief was false, only that the textual support commonly cited for it was less solid than popularly assumed, a distinction later scholars sympathetic to the doctrine have pressed him on without overturning his specific findings on the chains themselves.
Sources Sunan Abi DawudAbu Dawud al-Sijistani with The Muqaddimah: An Introduction to HistoryIbn Khaldun; translated by Franz Rosenthal