Commit 5f5fa4c
committed
Bluetooth: MGMT: Fix dangling pointer on mgmt_add_adv_patterns_monitor_complete
This fixes the condition checking so mgmt_pending_valid is executed
whenever status != -ECANCELED otherwise calling mgmt_pending_free(cmd)
would kfree(cmd) without unlinking it from the list first, leaving a
dangling pointer. Any subsequent list traversal (e.g.,
mgmt_pending_foreach during __mgmt_power_off, or another
mgmt_pending_valid call) would dereference freed memory.
Link: https://lore.kernel.org/linux-bluetooth/[email protected]/T/#m1418f9c82eeff8510c1beaa21cf53af20db96c06
Fixes: 302a1f6 ("Bluetooth: MGMT: Fix possible UAFs")
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
Reviewed-by: Paul Menzel <[email protected]>1 parent 598dbba commit 5f5fa4c
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5355 | 5355 | | |
5356 | 5356 | | |
5357 | 5357 | | |
5358 | | - | |
| 5358 | + | |
5359 | 5359 | | |
5360 | 5360 | | |
5361 | 5361 | | |
| |||
0 commit comments