mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 15:03:52 +08:00
scsi: ufs: bsg: Set bsg_queue to NULL after removal
Currently, this does not cause any issues, but I believe it is necessary to set bsg_queue to NULL after removing it to prevent potential use-after-free (UAF) access. Signed-off-by: Guixin Liu <kanie@linux.alibaba.com> Link: https://lore.kernel.org/r/20241218014214.64533-3-kanie@linux.alibaba.com Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
committed by
Martin K. Petersen
parent
fcf247deb3
commit
1e95c798d8
@@ -216,6 +216,7 @@ void ufs_bsg_remove(struct ufs_hba *hba)
|
||||
return;
|
||||
|
||||
bsg_remove_queue(hba->bsg_queue);
|
||||
hba->bsg_queue = NULL;
|
||||
|
||||
device_del(bsg_dev);
|
||||
put_device(bsg_dev);
|
||||
|
||||
Reference in New Issue
Block a user