Patch "scsi: ses: Fix slab-out-of-bounds in ses_intf_remove()" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    scsi: ses: Fix slab-out-of-bounds in ses_intf_remove()

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     scsi-ses-fix-slab-out-of-bounds-in-ses_intf_remove.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 578797f0c8cbc2e3ec5fc0dab87087b4c7073686 Mon Sep 17 00:00:00 2001
From: Tomas Henzl <thenzl@xxxxxxxxxx>
Date: Thu, 2 Feb 2023 17:24:51 +0100
Subject: scsi: ses: Fix slab-out-of-bounds in ses_intf_remove()

From: Tomas Henzl <thenzl@xxxxxxxxxx>

commit 578797f0c8cbc2e3ec5fc0dab87087b4c7073686 upstream.

A fix for:

BUG: KASAN: slab-out-of-bounds in ses_intf_remove+0x23f/0x270 [ses]
Read of size 8 at addr ffff88a10d32e5d8 by task rmmod/12013

When edev->components is zero, accessing edev->component[0] members is
wrong.

Link: https://lore.kernel.org/r/20230202162451.15346-5-thenzl@xxxxxxxxxx
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Tomas Henzl <thenzl@xxxxxxxxxx>
Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/scsi/ses.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/scsi/ses.c
+++ b/drivers/scsi/ses.c
@@ -856,7 +856,8 @@ static void ses_intf_remove_enclosure(st
 	kfree(ses_dev->page2);
 	kfree(ses_dev);
 
-	kfree(edev->component[0].scratch);
+	if (edev->components)
+		kfree(edev->component[0].scratch);
 
 	put_device(&edev->edev);
 	enclosure_unregister(edev);


Patches currently in stable-queue which might be from thenzl@xxxxxxxxxx are

queue-5.10/scsi-mpt3sas-fix-a-memory-leak.patch
queue-5.10/scsi-ses-fix-possible-desc_ptr-out-of-bounds-accesses.patch
queue-5.10/scsi-ses-fix-slab-out-of-bounds-in-ses_enclosure_data_process.patch
queue-5.10/scsi-ses-fix-possible-addl_desc_ptr-out-of-bounds-accesses.patch
queue-5.10/scsi-ses-fix-slab-out-of-bounds-in-ses_intf_remove.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux