Skip to contentSkip to conversation

CVE-2026-31498: Bluetooth: L2CAP: Fix ERTM re-init and zero pdu_len infinite loop

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: L2CAP: Fix ERTM re-init and zero pdu_len infinite loop

l2cap_config_req() processes CONFIG_REQ for channels in BT_CONNECTED state to support L2CAP reconfiguration (e.g. MTU changes). However, since both CONF_INPUT_DONE and CONF_OUTPUT_DONE are already set from the initial configuration, the reconfiguration path falls through to l2cap_ertm_init(), which re-initializes tx_q, srej_q, srej_list, and retrans_list without freeing the previous allocations and sets chan->sdu to NULL without freeing the existing skb. This leaks all previously allocated ERTM resources.

Additionally, l2cap_parse_conf_req() does not validate the minimum value of remote_mps derived from the RFC max_pdu_size option. A zero value propagates to l2cap_segment_sdu() where pdu_len becomes zero, causing the while loop to never terminate since len is never decremented, exhausting all available memory.

Fix the double-init by skipping l2cap_ertm_init() and l2cap_chan_ready() when the channel is already in BT_CONNECTED state, while still allowing the reconfiguration parameters to be updated through l2cap_parse_conf_req(). Also add a pdu_len zero check in l2cap_segment_sdu() as a safeguard.

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

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

	Issue introduced in 5.7 with commit 96298f640104e4cd9a913a6e50b0b981829b94ff and fixed in 5.10.253 with commit 9760b83cfd24b38caee663f429011a0dd6064fa9
	Issue introduced in 5.7 with commit 96298f640104e4cd9a913a6e50b0b981829b94ff and fixed in 5.15.203 with commit de37e2655b7abc3f59254c6b72256840f39fc6d5
	Issue introduced in 5.7 with commit 96298f640104e4cd9a913a6e50b0b981829b94ff and fixed in 6.1.168 with commit e7aab23b7df89a3d754a5f0a7d2237548b328bd0
	Issue introduced in 5.7 with commit 96298f640104e4cd9a913a6e50b0b981829b94ff and fixed in 6.6.131 with commit 52667c859fe33f70c2e711cb81bbd505d5eb8e75
	Issue introduced in 5.7 with commit 96298f640104e4cd9a913a6e50b0b981829b94ff and fixed in 6.12.80 with commit 9a21a631ee034b1573dce14b572a24943dbfd7ae
	Issue introduced in 5.7 with commit 96298f640104e4cd9a913a6e50b0b981829b94ff and fixed in 6.18.21 with commit 900e4db5385ec2cacd372345a80ab9c8e105b3a3
	Issue introduced in 5.7 with commit 96298f640104e4cd9a913a6e50b0b981829b94ff and fixed in 6.19.11 with commit 042e2cd4bb11e5313b19b87593616524949e4c52
	Issue introduced in 5.7 with commit 96298f640104e4cd9a913a6e50b0b981829b94ff and fixed in 7.0 with commit 25f420a0d4cfd61d3d23ec4b9c56d9f443d91377
	Issue introduced in 4.4.238 with commit 4ad03ff6f680681c5f78254e37c4c856fa953629
	Issue introduced in 4.9.238 with commit b7d0ca715c1008acd2fc018f02a56fed88f78b75
	Issue introduced in 4.14.200 with commit 799263eb37a4f7f6d39334046929c3bc92452a7f
	Issue introduced in 4.19.149 with commit 8828622fb9b4201eeb0870587052e3d834cfaf61
	Issue introduced in 5.4.69 with commit b432ea85ab8472763870dd0f2c186130dd36d68c

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-31498

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/9760b83cfd24b38caee663f429011a0dd6064fa9
	https://git.kernel.org/stable/c/de37e2655b7abc3f59254c6b72256840f39fc6d5
	https://git.kernel.org/stable/c/e7aab23b7df89a3d754a5f0a7d2237548b328bd0
	https://git.kernel.org/stable/c/52667c859fe33f70c2e711cb81bbd505d5eb8e75
	https://git.kernel.org/stable/c/9a21a631ee034b1573dce14b572a24943dbfd7ae
	https://git.kernel.org/stable/c/900e4db5385ec2cacd372345a80ab9c8e105b3a3
	https://git.kernel.org/stable/c/042e2cd4bb11e5313b19b87593616524949e4c52
	https://git.kernel.org/stable/c/25f420a0d4cfd61d3d23ec4b9c56d9f443d91377