Commit 9c325639 authored by Martin Wilck's avatar Martin Wilck Committed by Jhih-Chen Huang (xWF)
Browse files

UPSTREAM: scsi: sd: Fix off-by-one error in sd_read_block_characteristics()



commit f81eaf08 upstream.

Ff the device returns page 0xb1 with length 8 (happens with qemu v2.x, for
example), sd_read_block_characteristics() may attempt an out-of-bounds
memory access when accessing the zoned field at offset 8.

Fixes: 7fb019c4 ("scsi: sd: Switch to using scsi_device VPD pages")

Bug: 377605240

Cc: stable@vger.kernel.org
Change-Id: Idad41e9cf8e23b8dfee77c0b29e984cb468d1256
Signed-off-by: default avatarMartin Wilck <mwilck@suse.com>
Link: https://lore.kernel.org/r/20240912134308.282824-1-mwilck@suse.com


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 568c7c4c)
parent 2a45e9b2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment