]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: ses: Fix slab-out-of-bounds in ses_enclosure_data_process()
authorTomas Henzl <thenzl@redhat.com>
Thu, 2 Feb 2023 16:24:48 +0000 (17:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:44:06 +0000 (16:44 +0100)
commitf65b8d2141e4519f52eb0c958d800e531964e9bf
tree39cc492fc720a73db0771f7b012ef91f48cd3b1a
parentad9e146010189814a71c15514c56daf6fa334ce6
scsi: ses: Fix slab-out-of-bounds in ses_enclosure_data_process()

commit 9b4f5028e493cb353a5c8f5c45073eeea0303abd upstream.

A fix for:

BUG: KASAN: slab-out-of-bounds in ses_enclosure_data_process+0x949/0xe30 [ses]
Read of size 1 at addr ffff88a1b043a451 by task systemd-udevd/3271

Checking after (and before in next loop) addl_desc_ptr[1] is sufficient, we
expect the size to be sanitized before first access to addl_desc_ptr[1].
Make sure we don't walk beyond end of page.

Link: https://lore.kernel.org/r/20230202162451.15346-2-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