I asked Ibn Masud, "Did any of you accompany the Messenger of Allah ﷺ on the night of the jinn?"He replied, "No. But we were with the Messenger of Allah ﷺ one night, and we lost him. We searched for him in the valleys and mountain passes, and we said, 'He has been snatched away, or he has been assassinated.' We spent the worst night that any people ever spent. When morning came, we suddenly saw him coming from the direction of Hira."He said, "We said, 'Messenger of Allah, we lost you and searched for you but could not find you, and we spent the worst night that any people ever spent.'"He said, "A caller from the jinn came to me, so I went with him and recited the Quran to them."He said, "He then took us along and showed us their traces and the traces of their fires. They had asked him for provisions, and he told them, 'Every bone over which the name of Allah has been mentioned that falls into your hands will be yours, with as much flesh on it as possible. And every piece of dung will be fodder for your animals.'"The Messenger of Allah ﷺ then said, "So do not use these two for cleaning yourselves after relieving yourselves, for they are the food of your brethren."
سألت ابن مسعود فقلت: هل شهد أحد منكم مع رسول الله ﷺ ليلة الجن؟ قال: لا. ولكنا كنا مع رسول الله ﷺ ذات ليلة، ففقدناه، فالتمسناه في الأودية والشعاب، فقلنا: استطير، أو اغتيل! قال: فبتنا بشر ليلة بات بها قوم فلما أصبحنا إذا هو جاء من قبل حراء قال: فقلنا: يا رسول الله! فقدناك فطلبناك فلم نجدك فبتنا بشر ليلة بات بها قوم. فقال: أتاني داعي الجن، فذهبت معه، فقرأت عليهم القرآن. قال: فانطلق بنا فأرانا آثارهم وآثار نيرانهم. وسألوه الزاد. فقال: لكم كل عظم ذكر اسم الله عليه يقع في أيديكم أوفر ما يكون لحما. وكل بعرة علف لدوابكم. فقال رسول الله ﷺ: فلا تستنجوا بهما؛ فإنهما طعام إخوانكم.
Muslim narrated it in "The Prayer" (450), from Muhammad bin Muthanna, who said, Abdul-Ala narrated to us, from Dawud, from Amir, who said, I asked Alqama, "Was Ibn Masud present with the Messenger of Allah ﷺ on the night of the jinn?" He said, Alqama replied... and he related it.Ibn Khuzayma said in his Sahih (82), after narrating it through the route of Abdul-Ala and Yahya bin Abu Zaida, both from Dawud bin Abu Hind, from Amir Shaybi, "This is the wording of Abdul-Ala's hadith. In the hadith of Ibn Abu Zaida he said, the Messenger of Allah ﷺ said, 'Do not cleanse yourselves with bone or dung, for they are provisions for your brothers among the jinn.'"