Sahih Muslim - صحيح مسلم
28. The Book of Oaths, Muharibin, Qasas (Retaliation), and Diyat (Blood Money) - كتاب القسامة والمحاربين والقصاص والديات
4) Chapter: If a person attacks another person's life and limb, and the other defends himself and kills him or injures him, there is no penalty on him
This hadith has been transmitted on the authority of Ya'la.
4) باب الصَّائِلُ عَلَى نَفْسِ الإِنْسَانِ أَوْ عُضْوِهِ إِذَا دَفَعَهُ الْمَصُولُ عَلَيْهِ فَأَتْلَفَ نَفْسَهُ أَوْ عُضْوَهَ لاَ ضَمَانَ عَلَيْهِ
وَحَدَّثَنَا مُحَمَّدُ بْنُ الْمُثَنَّى، وَابْنُ، بَشَّارٍ قَالاَ حَدَّثَنَا مُحَمَّدُ بْنُ جَعْفَرٍ، حَدَّثَنَا شُعْبَةُ، عَنْ قَتَادَةَ، عَنْ عَطَاءٍ، عَنِ ابْنِ يَعْلَى، عَنْ يَعْلَى، عَنِ النَّبِيِّ صلى الله عليه وسلم بِمِثْلِهِ .