Commit 8bc83f9
Bluetooth: mgmt: fix locking in unpair_device/disconnect_sync
[ Upstream commit 16cd664 ]
Dereferencing RCU-protected pointers outside critical sections is
invalid and may lead to UAF.
Take hdev->lock for hci_conn lookup and hci_abort_conn(). Don't use RCU
to ensure the conn is fully initialized at this point.
Fixes: 227a0cd ("Bluetooth: MGMT: Fix not generating command complete for MGMT_OP_DISCONNECT")
Signed-off-by: Pauli Virtanen <pav@iki.fi>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 70354db commit 8bc83f9
1 file changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3005 | 3005 | | |
3006 | 3006 | | |
3007 | 3007 | | |
| 3008 | + | |
| 3009 | + | |
3008 | 3010 | | |
3009 | 3011 | | |
3010 | 3012 | | |
3011 | 3013 | | |
3012 | 3014 | | |
3013 | 3015 | | |
3014 | 3016 | | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
3015 | 3022 | | |
3016 | 3023 | | |
3017 | 3024 | | |
3018 | 3025 | | |
3019 | 3026 | | |
3020 | 3027 | | |
3021 | 3028 | | |
| 3029 | + | |
3022 | 3030 | | |
3023 | 3031 | | |
3024 | 3032 | | |
| |||
3166 | 3174 | | |
3167 | 3175 | | |
3168 | 3176 | | |
| 3177 | + | |
| 3178 | + | |
3169 | 3179 | | |
3170 | 3180 | | |
3171 | 3181 | | |
3172 | 3182 | | |
3173 | 3183 | | |
3174 | 3184 | | |
3175 | 3185 | | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
3176 | 3191 | | |
3177 | 3192 | | |
3178 | 3193 | | |
3179 | 3194 | | |
3180 | 3195 | | |
3181 | 3196 | | |
3182 | 3197 | | |
| 3198 | + | |
3183 | 3199 | | |
3184 | 3200 | | |
3185 | 3201 | | |
| |||
0 commit comments