Commit 1e95c798 authored by Guixin Liu's avatar Guixin Liu Committed by Martin K. Petersen
Browse files

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: default avatarGuixin Liu <kanie@linux.alibaba.com>
Link: https://lore.kernel.org/r/20241218014214.64533-3-kanie@linux.alibaba.com


Reviewed-by: default avatarAvri Altman <avri.altman@wdc.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent fcf247de
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);