Files
linux/drivers
Gaosheng Cui 1eee2b49a7 scsi: snic: Fix possible UAF in snic_tgt_create()
[ Upstream commit e118df4923 ]

Smatch reports a warning as follows:

drivers/scsi/snic/snic_disc.c:307 snic_tgt_create() warn:
  '&tgt->list' not removed from list

If device_add() fails in snic_tgt_create(), tgt will be freed, but
tgt->list will not be removed from snic->disc.tgt_list, then list traversal
may cause UAF.

Remove from snic->disc.tgt_list before free().

Fixes: c8806b6c9e ("snic: driver for Cisco SCSI HBA")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Link: https://lore.kernel.org/r/20221117035100.2944812-1-cuigaosheng1@huawei.com
Acked-by: Narsimhulu Musini <nmusini@cisco.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-29 09:27:20 +09:00
..
2023-05-16 12:22:16 +09:00
2023-06-29 09:27:06 +09:00
2023-05-15 12:46:28 +09:00
2023-06-29 09:26:11 +09:00
2023-06-29 09:27:19 +09:00
2023-06-29 09:27:20 +09:00
2023-06-29 09:26:40 +09:00
2023-05-16 09:58:13 +09:00
2023-06-29 09:26:07 +09:00
2023-05-15 10:37:00 +09:00
2023-05-15 09:23:01 +09:00
2023-05-15 08:28:33 +09:00
2023-05-15 16:59:11 +09:00