Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_h4: Ignore the RFU bits of the ISO data load length
@ 2026-11-22 15:52 Simon Mikuda
  2026-11-22 17:32 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Mikuda @ 2026-11-22 15:52 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Simon Mikuda, Marcel Holtmann, Luiz Augusto von Dentz

The length in an ISO data packet header has 14 bits and 2 RFU bits, but
h4_recv_skb() reads all 16. Some controllers, for example an NXP one,
set the RFU bits in the first ISO packets after a BIG sync, so the
packet is rejected and the rest of the receive buffer is lost. If that
holds the Command Complete of the second LE Setup ISO Data Path, the
second BIS never gets ready and its channel stays silent.

First bytes of such packets, handle 148 and 149 with length 108:

    94 60 6c c0  (handle 148, PB 10 and TS 1, length 108, RFU bits 11)
    95 e0 6c 80  (handle 149, PB 10, TS 1 and RFU 1, length 108,
                  RFU bits 10)

Kernel log of a failing join:

    Bluetooth: hci0: Frame reassembly failed (-90)
    Bluetooth: hci0: Frame reassembly failed (-90)
    Bluetooth: hci0: command tx timeout

Steps to reproduce:
1. Start a broadcast with two BISes on another device.
2. Join it with such a controller on H:4. Often there is no sound or
   only the left channel.

Fixes: ef564119ba83 ("Bluetooth: hci_h4: Add support for ISO packets")
Signed-off-by: Simon Mikuda <simon.mikuda@streamunlimited.com>
---
 net/bluetooth/hci_h4.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/bluetooth/hci_h4.c b/net/bluetooth/hci_h4.c
index 86f809018062..ae0224b36ace 100644
--- a/net/bluetooth/hci_h4.c
+++ b/net/bluetooth/hci_h4.c
@@ -120,6 +120,11 @@ struct sk_buff *h4_recv_skb(struct hci_dev *hdev, u8 *alignment, u8 *padding,
 				/* Double octet variable length */
 				dlen = get_unaligned_le16(skb->data +
 							  pkts[i].loff);
+
+				/* The top two bits of the ISO length are RFU */
+				if (hci_skb_pkt_type(skb) == HCI_ISODATA_PKT)
+					dlen &= 0x3fff;
+
 				hci_skb_expect(skb) += dlen;
 
 				if (skb_tailroom(skb) < dlen) {

base-commit: 4fe38719e6738feaa90486e36b0790dd5d960a96
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-22 17:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 15:52 [PATCH] Bluetooth: hci_h4: Ignore the RFU bits of the ISO data load length Simon Mikuda
2026-11-22 17:32 ` bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox