CVE-2026-64403: Bluetooth: L2CAP: validate option length before reading conf opt value

Greg Kroah-Hartman <[email protected]> Sat, 25 Jul 2026 10:50:20 +0200
Newsgroups org.kernel.vger.linux-cve-announce
Message-ID <2026072530-CVE-2026-64403-31f1@gregkh>
From: Greg Kroah-Hartman <[email protected]>

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

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

Bluetooth: L2CAP: validate option length before reading conf opt value

l2cap_get_conf_opt() derives the option length from the
attacker-controlled opt->len field and immediately dereferences
opt->val (as u8, get_unaligned_le16() or get_unaligned_le32(), or a
raw pointer for the default case) before any caller has confirmed
that opt->len bytes are present in the buffer. The callers
(l2cap_parse_conf_req(), l2cap_parse_conf_rsp() and
l2cap_conf_rfc_get()) only detect a malformed option afterwards, once
the running length has gone negative, by which point the
out-of-bounds read has already executed.

An existing post-hoc length check keeps the garbage value from being
consumed, so this is not a data leak in the current control flow. It
is still a validate-after-use ordering bug: up to 4 bytes are read
past the end of the buffer before it is known to contain them, and it
is fragile to future changes in the callers.

Fix it at the source. Pass the end of the buffer into
l2cap_get_conf_opt() and refuse to touch opt->val unless the full
option (header + value) fits. Each caller computes an end pointer
once before the loop and checks the return value directly instead of
inferring the error from a negative length.

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


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

	Issue introduced in 5.1 with commit 7c9cbd0b5e38a1672fcd137894ace3b042dfbf69 and fixed in 5.10.261 with commit cca81b4bc672604a84f6d224a55cc77ec7dee619
	Issue introduced in 5.1 with commit 7c9cbd0b5e38a1672fcd137894ace3b042dfbf69 and fixed in 5.15.212 with commit f70d4aa88068096f35d73e3a05eff33c0a16b9cd
	Issue introduced in 5.1 with commit 7c9cbd0b5e38a1672fcd137894ace3b042dfbf69 and fixed in 6.1.178 with commit 7d871e969b941ce25653f7716203a0ea4d07ad4b
	Issue introduced in 5.1 with commit 7c9cbd0b5e38a1672fcd137894ace3b042dfbf69 and fixed in 6.6.145 with commit 98d93c226bdfaa79bbdd86981921d7f106374225
	Issue introduced in 5.1 with commit 7c9cbd0b5e38a1672fcd137894ace3b042dfbf69 and fixed in 6.12.96 with commit 996d3da39899aceb8f4910911a3f19a45a7d9d1b
	Issue introduced in 5.1 with commit 7c9cbd0b5e38a1672fcd137894ace3b042dfbf69 and fixed in 6.18.39 with commit 73abbaf91aa33da87c008fb62c148ade561bb606
	Issue introduced in 5.1 with commit 7c9cbd0b5e38a1672fcd137894ace3b042dfbf69 and fixed in 7.1.4 with commit 6b47bdaacfd0045687880177e0987055d8f4765a
	Issue introduced in 5.1 with commit 7c9cbd0b5e38a1672fcd137894ace3b042dfbf69 and fixed in 7.2-rc3 with commit 687617555cedfb74c9e3cb85d759b908dcb17856
	Issue introduced in 3.16.66 with commit 78c2887130f1a7d1883195732be1b6cdab667487
	Issue introduced in 3.18.138 with commit ac7c597c465eb09391e40febbe088bdad601080b
	Issue introduced in 4.4.178 with commit ade4560e4fea198866e033fe1c02f063d6d7db2e
	Issue introduced in 4.9.167 with commit 99665dcf6ff803351b5e658f3a929cb498561e36
	Issue introduced in 4.14.110 with commit 2b59d36f22622c92c0b06aee7571f0a86a217188
	Issue introduced in 4.19.33 with commit 15d6538a0d6e0f6de5116081a948cba7cc3e1d3d
	Issue introduced in 5.0.6 with commit a556547bae00528f24b42786b41a14047db14b84

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-64403
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/l2cap_core.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/cca81b4bc672604a84f6d224a55cc77ec7dee619
	https://git.kernel.org/stable/c/f70d4aa88068096f35d73e3a05eff33c0a16b9cd
	https://git.kernel.org/stable/c/7d871e969b941ce25653f7716203a0ea4d07ad4b
	https://git.kernel.org/stable/c/98d93c226bdfaa79bbdd86981921d7f106374225
	https://git.kernel.org/stable/c/996d3da39899aceb8f4910911a3f19a45a7d9d1b
	https://git.kernel.org/stable/c/73abbaf91aa33da87c008fb62c148ade561bb606
	https://git.kernel.org/stable/c/6b47bdaacfd0045687880177e0987055d8f4765a
	https://git.kernel.org/stable/c/687617555cedfb74c9e3cb85d759b908dcb17856