Commit aa5b817
scsi: scsi_debug: Fix possible UAF in sdebug_add_host_helper()
[ Upstream commit e208a1d ]
If device_register() fails in sdebug_add_host_helper(), it will goto clean
and sdbg_host will be freed, but sdbg_host->host_list will not be removed
from sdebug_host_list, then list traversal may cause UAF. Fix it.
Fixes: 1da177e ("Linux-2.6.12-rc2")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Link: https://lore.kernel.org/r/20221117084421.58918-1-yuancan@huawei.com
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent dce0589 commit aa5b817
1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7316 | 7316 | | |
7317 | 7317 | | |
7318 | 7318 | | |
7319 | | - | |
| 7319 | + | |
| 7320 | + | |
| 7321 | + | |
| 7322 | + | |
7320 | 7323 | | |
| 7324 | + | |
7321 | 7325 | | |
7322 | 7326 | | |
7323 | 7327 | | |
| |||
0 commit comments