]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: ses: Fix slab-out-of-bounds in ses_intf_remove()
authorTomas Henzl <thenzl@redhat.com>
Thu, 2 Feb 2023 16:24:51 +0000 (17:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:26:49 +0000 (16:26 +0100)
commit76f7050537476ac062ec23a544fbca8270f2d08b
treeec75a8888e559e93e5674260fbb103b14be85d12
parent72021ae61a2bc6ca73cd593e255a10ed5f5dc5e7
scsi: ses: Fix slab-out-of-bounds in ses_intf_remove()

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@redhat.com
Cc: stable@vger.kernel.org
Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/ses.c