It was narrated from ‘Alqamah that Ibn Mas’ud prostrated twice for the prostrations of forgetfulness after the Salam, and he mentioned that the Prophet (ﷺ) did that.”
حَدَّثَنَا أَبُو بَكْرِ بْنُ خَلاَّدٍ، حَدَّثَنَا سُفْيَانُ بْنُ عُيَيْنَةَ، عَنْ مَنْصُورٍ، عَنْ إِبْرَاهِيمَ، عَنْ عَلْقَمَةَ، أَنَّ ابْنَ مَسْعُودٍ، سَجَدَ سَجْدَتَىِ السَّهْوِ بَعْدَ السَّلاَمِ وَذَكَرَ أَنَّ النَّبِيَّ ـ صلى الله عليه وسلم ـ فَعَلَ ذَلِكَ .
IbnMaja
Establishing the Prayer and the Sunnah Regarding Them • Hadith 1218