Asim bin Sulayman reported,

I asked Anas bin Malik about Safa and Marwa, and he said, "We used to think that they were part of the practices of the age of ignorance, so when Islam came we refrained from them. Then Allah عز وجل revealed, "Indeed, Safa and Marwa are among the symbols of Allah. So whoever performs Hajj to the House or performs Umrah, there is no blame upon him for going between them. And whoever volunteers good, then indeed, Allah is Appreciative and Aleem" [Baqarah 2:158].

Azami 11936

Sahih

عن عاصم بن سليمان قال

سألت أنس بن مالك عن الصفا والمروة فقال: كنا نرى أنهما من أمر الجاهلية، فلما كان الإسلام أمسكنا عنهما فأنزل الله عز وجل: {إن الصفا والمروة من شعائر الله فمن حج البيت أو اعتمر فلا جناح عليه أن يطوف بهما ومن تطوع خيرا فإن الله شاكر عليم}

الأعظمي 11936صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Virtues of Surah Baqarah
Section
His saying, "Indeed Safa and Marwa are among the rites of Allah. So whoever performs pilgrimage to the House or performs umrah, there is no blame upon him for walking between them. And whoever volunteers good, then indeed Allah is Appreciative, Aleem"
Numbering
Jami al-Kamil 11936 (2nd edition)
Azami 11936