nuttx/wireless/bluetooth
Alan Carvalho de Assis c95c546c09 wireless/bluetooth: Fix record stride in descriptor discovery response.
att_find_info_rsp() computed the per-record stride with sizeof(info.i16)
and sizeof(info.i128), but "info" is a union of two pointers, so both
expressions evaluate to the pointer width instead of the size of the
record that the response format selects.  The records are 4 octets for a
16-bit UUID and 18 octets for a 128-bit UUID, so the 128-bit path
advanced by 4 (or 8) octets per iteration while reading an 18-octet
record: handles and UUIDs were parsed from the wrong offsets and the walk
ran past the end of the received PDU.  On 64-bit builds the 16-bit path
was wrong too.

Take the stride from the record structures, and require the response to
carry whole records before walking it, since the loop advances one record
at a time and a partial trailing record would be parsed as a whole one.

Ref: Core v6.0, Vol 3, Part F, 3.4.3.2 (ATT_FIND_INFORMATION_RSP)
Testing: sim:bluetooth builds with Make, no new warnings.  Not yet
exercised at runtime; the scriptable controller that can inject a
malformed Find Information Response is added separately.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
Assisted-by: Claude Code Opus 5
2026-09-18 11:18:36 +08:00
..
bt_atomic.h nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
bt_att.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
bt_att.h
bt_buf.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
bt_buf.h
bt_conn.c wireless/bluetooth: fix inverted MTU cap in bt_conn_send() 2026-08-30 10:48:18 -03:00
bt_conn.h style: Fix "the the" typo across the codebase. 2026-03-23 11:07:49 +01:00
bt_gatt.c wireless/bluetooth: Fix record stride in descriptor discovery response. 2026-09-18 11:18:36 +08:00
bt_hcicore.c wireless/bluetooth/bt_hcicore.c: Balance conn and buffer refs in hci_acl(). 2026-08-15 11:51:19 +08:00
bt_hcicore.h
bt_ioctl.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
bt_ioctl.h
bt_keys.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
bt_keys.h Bluetooth SMP: added support for Legacy pairing (MITM) with passkey 2025-05-28 21:49:08 +08:00
bt_l2cap.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
bt_l2cap.h
bt_netdev.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
bt_queue.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
bt_queue.h
bt_services.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
bt_smp.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
bt_smp.h Bluetooth SMP: added support for Legacy pairing (MITM) with passkey 2025-05-28 21:49:08 +08:00
bt_uuid.c
CMakeLists.txt
Kconfig Bluetooth SMP: added support for Legacy pairing (MITM) with passkey 2025-05-28 21:49:08 +08:00
Make.defs