Files
linux/include/net/bluetooth
Yifan Zhang 1eb52f35fc Bluetooth: validate retained LE Create CIS command length
hci_cs_le_create_cis() retrieves the parameters of the previously sent
command without their length.  It then trusts num_cis and walks the
flexible cis[] array when a controller reports a failed command.

A five-byte HCI command containing only num_cis can therefore make the
handler read beyond the command skb.  KASAN reports:

  BUG: KASAN: slab-out-of-bounds in hci_cs_le_create_cis
  Read of size 2
  hci_cs_le_create_cis
  hci_cmd_status_evt
  hci_event_packet

Add a length-returning saved-command helper and require the fixed header
and complete CIS array before walking it.

The reproducer no longer triggers a KASAN report with this change.

Fixes: 26afbd826e ("Bluetooth: Add initial implementation of CIS connections")
Closes: https://lore.kernel.org/linux-bluetooth/[email protected]/
Signed-off-by: Yifan Zhang <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
2026-11-02 17:09:03 -05:00
..
2022-07-22 17:14:13 -07:00