Commit 847050d
scsi: libiscsi: Fix UAF in iscsi_conn_get_param()/iscsi_conn_teardown()
[ Upstream commit 1b8d030 ]
|- iscsi_if_destroy_conn |-dev_attr_show
|-iscsi_conn_teardown
|-spin_lock_bh |-iscsi_sw_tcp_conn_get_param
|-kfree(conn->persistent_address) |-iscsi_conn_get_param
|-kfree(conn->local_ipaddr)
==>|-read persistent_address
==>|-read local_ipaddr
|-spin_unlock_bh
When iscsi_conn_teardown() and iscsi_conn_get_param() happen in parallel, a
UAF may be triggered.
Link: https://lore.kernel.org/r/046ec8a0-ce95-d3fc-3235-666a7c65b224@huawei.com
Reported-by: Lu Tixiong <lutianxiong@huawei.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Lixiaokeng <lixiaokeng@huawei.com>
Signed-off-by: Linfeilong <linfeilong@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 6ebb685 commit 847050d
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3101 | 3101 | | |
3102 | 3102 | | |
3103 | 3103 | | |
| 3104 | + | |
| 3105 | + | |
3104 | 3106 | | |
3105 | 3107 | | |
3106 | 3108 | | |
| |||
3122 | 3124 | | |
3123 | 3125 | | |
3124 | 3126 | | |
3125 | | - | |
3126 | | - | |
3127 | 3127 | | |
3128 | 3128 | | |
3129 | 3129 | | |
| |||
3135 | 3135 | | |
3136 | 3136 | | |
3137 | 3137 | | |
| 3138 | + | |
| 3139 | + | |
3138 | 3140 | | |
3139 | 3141 | | |
3140 | 3142 | | |
| |||
0 commit comments