summaryrefslogtreecommitdiff
path: root/rust/kernel
diff options
context:
space:
mode:
authorChris Lu <chris.lu@mediatek.com>2026-10-22 11:21:49 +0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2026-11-02 17:09:01 -0500
commitd015faf684129a276f2137ad2e11c6c985294648 (patch)
tree86335d962b6cd83931b8fcf1e2c549e1444438c7 /rust/kernel
parent8524c3588fbb9d5c1b876e6f908c42926845650d (diff)
Bluetooth: btmtk: bound the ISO payload length by the controller's MTU
btmtk_recv_isopkt() bounds the Data_Total_Length reported by the controller with skb_tailroom(skb) < hci_skb_expect(skb). That keeps the reassembly inside the skb, but it enforces no protocol limit: the head allocation is rounded up to the next kmalloc bucket and skb_tailroom() reports what the bucket can hold rather than what was requested, which is several hundred bytes more. An oversized length therefore passes, and the parser keeps pulling bytes out of the following transfers to fill it, swallowing the real ISO packets they carry until the frame is handed to hci_recv_frame(). The controller reports the largest ISO_Data_Packet_Length it will send in LE Read Buffer Size [v2], which hci_cc_le_read_buffer_size_v2() keeps in hdev->iso_mtu. Once that is available, bound the length by it and size the receive skb to hold that much plus the 4-byte header. HCI_MAX_ISO_SIZE is kept only as a fallback for the window before the command completes. Keep the skb_tailroom() test as well, because a fragment started before hdev->iso_mtu was populated sits in an skb sized for the fallback. Fixes: ceac1cb0259d ("Bluetooth: btusb: mediatek: add ISO data transmission functions") Co-developed-by: Hao Qin <hao.qin@mediatek.com> Signed-off-by: Hao Qin <hao.qin@mediatek.com> Co-developed-by: Wenlong Tian <ot_wenlong.tian@mediatek.com> Signed-off-by: Wenlong Tian <ot_wenlong.tian@mediatek.com> Signed-off-by: Chris Lu <chris.lu@mediatek.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'rust/kernel')
0 files changed, 0 insertions, 0 deletions