Asim bin Sulayman reported,

I asked Anas bin Malik رضي الله عنه about Safa and Marwa. He said, "We used to consider them part of the practices of the Days of Ignorance, so when Islam came, we refrained from them. Then Allah the Exalted revealed, 'Indeed, Safa and Marwa are among the symbols of Allah. So whoever makes Hajj to the House or performs Umrah, there is no blame upon him for walking between them' [Baqarah 2:158]."

Bukhari 4496

Sahih

حدثنا محمد بن يوسف حدثنا سفيان

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

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

البخاري 4496صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tafsir
Chapter
His saying, "Indeed Safa and Marwa are among the rites of Allah. So whoever performs hajj 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
Darussalam 4496
Bukhari 4496