Muwatta Malik #563
Burials
The Arabic includes the chain of narration (sanad) and the collector's commentary; the English translation shows the Prophet's words only.
وَحَدَّثَنِي عَنْ مَالِكٍ، أَنَّهُ بَلَغَهُ أَنَّ عَلِيَّ بْنَ أَبِي طَالِبٍ، كَانَ يَتَوَسَّدُ الْقُبُورَ وَيَضْطَجِعُ عَلَيْهَا . قَالَ مَالِكٌ وَإِنَّمَا نُهِيَ عَنِ الْقُعُودِ عَلَى الْقُبُورِ فِيمَا نُرَى لِلْمَذَاهِبِ .
ahya related to me from Malik that he had heard that AIi ibn Abi
Talib used to rest his head on graves and lie on them.
Malik
said, "As far as we can see ,it is only forbidden to sit on graves to
relieve oneself."
About Muwatta Malik
This hadith is #563 from Muwatta Malik, in the Book of Burials.