No sooner had Khaybar been conquered than we came upon that vegetable, and we ate from it greedily, for the people were hungry. Then we set out for the mosque, and the Messenger of Allah ﷺ caught its smell and said, "Whoever has eaten anything of this foul plant should not come near us in the mosque."The people said, "It has been forbidden, it has been forbidden!"Word of this reached the Messenger of Allah ﷺ, so he said, "People, it is not for me to forbid what Allah has made lawful, but it is a plant whose smell I find unpleasant."
حدثنا إسماعيل أخبرنا الجريري عن أبي نضرة
لم نعد أن فتحت خيبر وقعنا في تلك البقلة فأكلنا منها أكلا شديدا وناس جياع ثم رحلنا إلى المسجد فوجد رسول الله ﷺ الريح فقال من أكل من هذه الشجرة الخبيثة شيئا فلا يقربنا في المسجد فقال الناس حرمت حرمت فبلغ ذلك رسول الله ﷺ فقال أيها الناس إنه ليس لي تحريم ما أحل الله ولكنها شجرة أكره ريحها
Its isnad is sahih, like the one before it. The hadith is found in Bukhari 1/217, in the chapter on adhan, what has been reported about the Prophet sleeping, and in Muslim 1/395, and in Tirmidhi 4/261, number 1806, where he said, hasan sahih.