]> git.ipfire.org Git - thirdparty/linux.git/commit
Bluetooth: RFCOMM: validate skb length in MCC handlers
authorSeungJu Cheon <suunj1331@gmail.com>
Mon, 25 May 2026 11:04:43 +0000 (20:04 +0900)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 3 Jun 2026 15:21:03 +0000 (11:21 -0400)
commit23882b828c3c8c51d0c946446a396b10abb3b16b
tree52a3222e637bf0d918d71008f111c1c65a4ac3d5
parentde23fb62259aa01d294f77238ae3b835eb674413
Bluetooth: RFCOMM: validate skb length in MCC handlers

The RFCOMM MCC handlers cast skb->data to protocol-specific structs
without validating skb->len first. A malicious remote device can send
truncated MCC frames and trigger out-of-bounds reads in these handlers.

Fix this by using skb_pull_data() to validate and access the required
data before dereferencing it.

rfcomm_recv_rpn() requires special handling since ETSI TS 07.10 allows
1-byte RPN requests. Handle this by validating only the DLCI byte first,
and validating the full struct only when len > 1.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Suggested-by: Muhammad Bilal <meatuni001@gmail.com>
Signed-off-by: SeungJu Cheon <suunj1331@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/rfcomm/core.c