From 1907dd956515ede00f5c1aa7f90493eaa65cd52a Mon Sep 17 00:00:00 2001 From: Suraj Sonawane Date: Fri, 15 Nov 2024 19:03:07 +0530 Subject: [PATCH] KASAN: fix slab-use-after-free Read in sg_release syz test Signed-off-by: Suraj Sonawane --- drivers/scsi/sg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index f86be197f..630d15620 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -2234,6 +2234,7 @@ sg_remove_sfp_usercontext(struct work_struct *work) SCSI_LOG_TIMEOUT(6, sg_printk(KERN_INFO, sdp, "sg_remove_sfp: sfp=0x%p\n", sfp)); kfree(sfp); + sfp = NULL; kref_put(&sdp->d_ref, sg_device_destroy); scsi_device_put(device); -- 2.34.1