Skip to content

Commit 1e95c79

Browse files
guixinliu1995martinkpetersen
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Avri Altman <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent fcf247d commit 1e95c79

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/ufs/core/ufs_bsg.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ void ufs_bsg_remove(struct ufs_hba *hba)
216216
return;
217217

218218
bsg_remove_queue(hba->bsg_queue);
219+
hba->bsg_queue = NULL;
219220

220221
device_del(bsg_dev);
221222
put_device(bsg_dev);

0 commit comments

Comments
 (0)