linux/net/bluetooth
Lukas Johannes Möller dd815e6e39 Bluetooth: L2CAP: Validate L2CAP_INFO_RSP payload length before access
l2cap_information_rsp() checks that cmd_len covers the fixed
l2cap_info_rsp header (type + result, 4 bytes) but then reads
rsp->data without verifying that the payload is present:

 - L2CAP_IT_FEAT_MASK calls get_unaligned_le32(rsp->data), which reads
   4 bytes past the header (needs cmd_len >= 8).

 - L2CAP_IT_FIXED_CHAN reads rsp->data[0], 1 byte past the header
   (needs cmd_len >= 5).

A truncated L2CAP_INFO_RSP with result == L2CAP_IR_SUCCESS triggers an
out-of-bounds read of adjacent skb data.

Guard each data access with the required payload length check.  If the
payload is too short, skip the read and let the state machine complete
with safe defaults (feat_mask and remote_fixed_chan remain zero from
kzalloc), so the info timer cleanup and l2cap_conn_start() still run
and the connection is not stalled.

Fixes: 4e8402a3f8 ("[Bluetooth] Retrieve L2CAP features mask on connection setup")
Cc: stable@vger.kernel.org
Signed-off-by: Lukas Johannes Möller <research@johannes-moeller.dev>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2026-03-12 15:29:07 -04:00
..
bnep
cmtp Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hidp Bluetooth: HIDP: Fix possible UAF 2026-03-12 15:27:46 -04:00
rfcomm Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
6lowpan.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig
Makefile Bluetooth: Introduce HCI Driver protocol 2025-05-21 10:28:07 -04:00
af_bluetooth.c Bluetooth: ISO: add socket option to report packet seqnum via CMSG 2025-07-23 10:31:19 -04:00
aosp.c Bluetooth: aosp: Fix typo in comment 2025-07-23 10:30:18 -04:00
aosp.h
coredump.c Bluetooth: hci_devcd_dump: fix out-of-bounds via dev_coredumpv 2025-07-23 10:33:57 -04:00
ecdh_helper.c
ecdh_helper.h
eir.c Bluetooth: eir: Fix possible crashes on eir_create_adv_data 2025-06-11 16:29:22 -04:00
eir.h Bluetooth: eir: Fix possible crashes on eir_create_adv_data 2025-06-11 16:29:22 -04:00
hci_codec.c
hci_codec.h
hci_conn.c Bluetooth: ISO: Fix defer tests being unstable 2026-03-12 15:26:48 -04:00
hci_core.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hci_debugfs.c Bluetooth: hci_dev: replace 'quirks' integer by 'quirk_flags' bitmap 2025-07-16 15:37:53 -04:00
hci_debugfs.h
hci_drv.c Bluetooth: Introduce HCI Driver protocol 2025-05-21 10:28:07 -04:00
hci_event.c Bluetooth: Fix using PHYs bitfields as PHY value 2026-01-29 13:27:47 -05:00
hci_sock.c Bluetooth: purge error queues in socket destructors 2026-02-23 15:30:16 -05:00
hci_sync.c Bluetooth: hci_sync: Fix hci_le_create_conn_sync 2026-03-12 15:27:05 -04:00
hci_sysfs.c Bluetooth: Allow reset via sysfs 2025-01-15 10:37:07 -05:00
iso.c Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
l2cap_core.c Bluetooth: L2CAP: Validate L2CAP_INFO_RSP payload length before access 2026-03-12 15:29:07 -04:00
l2cap_sock.c Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
leds.c
leds.h
lib.c Bluetooth: Fix typos in comments 2025-07-23 10:30:48 -04:00
mgmt.c Bluetooth: MGMT: Fix list corruption and UAF in command complete handlers 2026-03-12 15:27:25 -04:00
mgmt_config.c Bluetooth: mgmt: Add idle_timeout to configurable system parameters 2026-01-29 13:24:22 -05:00
mgmt_config.h
mgmt_util.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mgmt_util.h Bluetooth: MGMT: Fix possible UAFs 2025-09-22 10:30:00 -04:00
msft.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
msft.h
sco.c Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
selftest.c
selftest.h
smp.c Bluetooth: SMP: make SM/PER/KDU/BI-04-C happy 2026-03-12 15:26:30 -04:00
smp.h Bluetooth: SMP: If an unallowed command is received consider it a failure 2025-07-16 15:33:30 -04:00