In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: MGMT: Fix list corruption and UAF in command complete handlers
Commit 302a1f674c00 ("Bluetooth: MGMT: Fix possible UAFs") introduced mgmt_pending_valid(), which not only validates the pending command but also unlinks it from the pending list if it is valid. This change in semantics requires updates to several completion handlers to avoid list corruption and memory safety issues.
This patch addresses two left-over issues from the aforementioned rework:
- In mgmt_add_adv_patterns_monitor_complete(), mgmt_pending_remove()
- In set_mesh_complete(), the use of mgmt_pending_foreach() in the error