From: Murthy Bhat Date: Fri, 28 Apr 2023 15:37:06 +0000 (-0500) Subject: scsi: smartpqi: Validate block layer host tag X-Git-Tag: v6.6.7~2388^2~86^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5c9e3c1c5276cf1f0de47f97eddf48ae1e7fd083;p=platform%2Fkernel%2Flinux-starfive.git scsi: smartpqi: Validate block layer host tag Prevent OS crashes when a drive is hot removed during I/O stress test. The I/O request pointer can be invalid if block layer provides incorrect multi-queue host tag. This can lead to invalid I/O request pointer dereference. Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Mike McGowen Reviewed-by: Kevin Barnett Signed-off-by: Murthy Bhat Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20230428153712.297638-7-don.brace@microchip.com Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 7fe80bef..f76b5a3 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -708,7 +708,8 @@ static inline struct pqi_io_request *pqi_alloc_io_request(struct pqi_ctrl_info * } } - pqi_reinit_io_request(io_request); + if (io_request) + pqi_reinit_io_request(io_request); return io_request; }