Skip to contentSkip to conversation

CVE-2026-31511: Bluetooth: MGMT: Fix dangling pointer on mgmt_add_adv_patterns_monitor_complete

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Apr 22

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

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.

The Linux kernel CVE team has assigned CVE-2026-31511 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.12.59 with commit d71b98f253b079cbadc83266383f26fe7e9e103b and fixed in 6.12.80 with commit 340666172cf747de58c283d2eef1f335f050538b
	Issue introduced in 6.17 with commit 302a1f674c00dd5581ab8e493ef44767c5101aab and fixed in 6.18.21 with commit bafec9325d4de26b6c49db75b5d5172de652aae0
	Issue introduced in 6.17 with commit 302a1f674c00dd5581ab8e493ef44767c5101aab and fixed in 6.19.11 with commit 3a89c33deffb3cb7877a7ea2e50734cd12b064f2
	Issue introduced in 6.17 with commit 302a1f674c00dd5581ab8e493ef44767c5101aab and fixed in 7.0 with commit 5f5fa4cd35f707344f65ce9e225b6528691dbbaa
	Issue introduced in 6.16.10 with commit 87a1f16f07c6c43771754075e08f45b41d237421

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-31511

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
net/bluetooth/mgmt.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/340666172cf747de58c283d2eef1f335f050538b
	https://git.kernel.org/stable/c/bafec9325d4de26b6c49db75b5d5172de652aae0
	https://git.kernel.org/stable/c/3a89c33deffb3cb7877a7ea2e50734cd12b064f2
	https://git.kernel.org/stable/c/5f5fa4cd35f707344f65ce9e225b6528691dbbaa