diff options
author | Gaosheng Cui | 2022-11-17 11:51:00 +0800 |
---|---|---|
committer | Greg Kroah-Hartman | 2022-12-31 13:32:35 +0100 |
commit | 4141cd9e8b3379aea52a85d2c35f6eaf26d14e86 (patch) | |
tree | 05007952a982666e359959e688df2f123fecf0b1 /init | |
parent | aef82d16be5a353d913163f26fc4385e296be2b8 (diff) |
scsi: snic: Fix possible UAF in snic_tgt_create()
[ Upstream commit e118df492320176af94deec000ae034cc92be754 ]
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: c8806b6c9e82 ("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>
Diffstat (limited to 'init')
0 files changed, 0 insertions, 0 deletions