Gaosheng Cui
3772319e40
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>
2023-01-18 09:26:22 +01:00
..
2020-10-01 13:12:37 +02:00
2021-07-28 11:12:15 +02:00
2019-02-12 19:46:13 +01:00
2020-08-21 09:48:08 +02:00
2021-07-20 16:17:55 +02:00
2022-04-20 09:08:26 +02:00
2022-02-08 18:16:29 +01:00
2021-07-20 16:17:49 +02:00
2021-11-26 11:40:33 +01:00
2021-07-20 16:17:49 +02:00
2019-02-12 19:46:12 +01:00
2021-08-26 08:37:07 -04:00
2020-01-23 08:20:36 +01:00
2023-01-18 09:26:21 +01:00
2020-12-29 13:47:00 +01:00
2020-06-11 09:22:55 +02:00
2021-02-07 14:47:41 +01:00
2022-04-20 09:08:32 +02:00
2019-12-01 09:13:29 +01:00
2022-04-20 09:08:27 +02:00
2022-04-20 09:08:10 +02:00
2022-06-25 11:46:43 +02:00
2021-08-26 08:37:07 -04:00
2022-09-15 12:23:52 +02:00
2022-04-20 09:08:32 +02:00
2022-04-20 09:08:27 +02:00
2020-01-09 10:17:58 +01:00
2021-09-22 11:45:26 +02:00
2022-05-25 08:41:21 +02:00
2020-10-29 09:07:04 +01:00
2022-08-25 11:11:22 +02:00
2023-01-18 09:26:22 +01:00
2019-11-20 17:59:54 +01:00
2022-08-25 11:11:09 +02:00
2022-10-26 13:17:12 +02:00
2018-09-19 22:43:42 +02:00
2018-09-19 22:43:42 +02:00
2019-03-13 14:03:15 -07:00
2021-11-26 11:40:38 +01:00
2022-04-20 09:08:27 +02:00
2020-01-04 13:59:44 +01:00
2021-09-22 11:45:32 +02:00
2021-06-03 08:36:22 +02:00
2019-10-29 09:17:32 +01:00
2022-06-14 16:53:53 +02:00
2018-11-13 11:14:56 -08:00
2018-11-13 11:14:56 -08:00
2021-07-20 16:17:40 +02:00
2020-09-09 19:03:12 +02:00
2021-10-27 09:51:41 +02:00
2019-07-10 09:54:35 +02:00
2023-01-18 09:26:21 +01:00
2018-08-15 18:12:47 +02:00
2023-01-18 09:26:21 +01:00
2020-04-02 16:34:27 +02:00
2019-12-01 09:13:27 +01:00
2020-06-25 15:41:56 +02:00
2020-02-28 16:36:04 +01:00
2021-05-22 10:57:31 +02:00
2019-11-10 11:25:11 +01:00
2022-01-11 13:57:37 +01:00
2018-11-13 11:14:56 -08:00
2020-01-04 13:59:44 +01:00
2022-06-14 16:53:45 +02:00
2020-08-21 09:48:10 +02:00
2020-10-29 09:07:16 +01:00
2020-01-04 13:59:48 +01:00
2019-11-20 18:00:48 +01:00
2022-06-25 11:46:43 +02:00
2019-05-16 19:42:27 +02:00
2021-12-22 09:18:01 +01:00
2020-06-30 15:37:57 -04:00
2019-05-08 07:20:49 +02:00
2019-10-29 09:17:31 +01:00
2021-07-20 16:17:41 +02:00
2019-10-07 18:55:06 +02:00
2019-01-23 08:09:48 +01:00
2021-08-26 08:37:07 -04:00
2021-11-12 14:28:22 +01:00
2020-01-23 08:20:37 +01:00
2021-12-08 08:46:54 +01:00
2020-07-29 07:42:51 +02:00
2021-04-28 12:08:40 +02:00
2021-11-12 14:28:22 +01:00
2018-07-25 11:25:06 +02:00
2021-10-09 14:09:46 +02:00
2021-10-17 10:08:34 +02:00
2022-08-25 11:11:30 +02:00
2021-05-22 10:57:31 +02:00
2018-05-30 07:51:49 +02:00
2022-01-27 09:00:58 +01:00
2022-01-27 09:00:58 +01:00
2021-04-07 12:47:01 +02:00
2022-10-26 13:16:54 +02:00
2019-05-08 07:20:50 +02:00
2020-01-04 13:59:44 +01:00
2021-05-22 10:57:31 +02:00
2021-10-17 10:08:34 +02:00
2022-01-05 12:33:49 +01:00
2022-06-25 11:46:42 +02:00
2022-03-11 10:13:32 +01:00
2022-04-20 09:08:29 +02:00