Commit 579faba
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 65ce6fe commit 579faba
1 file changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3012 | 3012 | | |
3013 | 3013 | | |
3014 | 3014 | | |
| 3015 | + | |
| 3016 | + | |
3015 | 3017 | | |
3016 | 3018 | | |
3017 | 3019 | | |
3018 | 3020 | | |
3019 | 3021 | | |
3020 | 3022 | | |
3021 | 3023 | | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
3022 | 3029 | | |
3023 | 3030 | | |
3024 | 3031 | | |
3025 | 3032 | | |
3026 | 3033 | | |
3027 | 3034 | | |
3028 | 3035 | | |
| 3036 | + | |
3029 | 3037 | | |
3030 | 3038 | | |
3031 | 3039 | | |
| |||
3173 | 3181 | | |
3174 | 3182 | | |
3175 | 3183 | | |
| 3184 | + | |
| 3185 | + | |
3176 | 3186 | | |
3177 | 3187 | | |
3178 | 3188 | | |
3179 | 3189 | | |
3180 | 3190 | | |
3181 | 3191 | | |
3182 | 3192 | | |
| 3193 | + | |
| 3194 | + | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
3183 | 3198 | | |
3184 | 3199 | | |
3185 | 3200 | | |
3186 | 3201 | | |
3187 | 3202 | | |
3188 | 3203 | | |
3189 | 3204 | | |
| 3205 | + | |
3190 | 3206 | | |
3191 | 3207 | | |
3192 | 3208 | | |
| |||
0 commit comments