Re: [PATCH][next] Bluetooth: hci_conn: Use __counted_by() and avoid -Wfamnae warning

2024-05-03 Thread patchwork-bot+bluetooth
Hello: This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz : On Thu, 2 May 2024 10:22:00 -0600 you wrote: > Prepare for the coming implementation by GCC and Clang of the > __counted_by attribute. Flexible array members annotated with > __counted_by can have t

Re: [PATCH][next] Bluetooth: hci_conn: Use __counted_by() and avoid -Wfamnae warning

2024-05-02 Thread Gustavo A. R. Silva
So, use the `DEFINE_FLEX()` helper for an on-stack definition of a flexible structure where the size of the flexible-array member is known at compile-time, and refactor the rest of the code, accordingly. With these changes, fix the following warning: net/bluetooth/hci_conn.c:669:41: warning: s

Re: [PATCH][next] Bluetooth: hci_conn: Use __counted_by() and avoid -Wfamnae warning

2024-05-02 Thread Kees Cook
On Thu, May 02, 2024 at 10:22:00AM -0600, Gustavo A. R. Silva wrote: > Prepare for the coming implementation by GCC and Clang of the > __counted_by attribute. Flexible array members annotated with > __counted_by can have their accesses bounds-checked at run-time > via CONFIG_UBSAN_BOUNDS (for array

[PATCH][next] Bluetooth: hci_conn: Use __counted_by() and avoid -Wfamnae warning

2024-05-02 Thread Gustavo A. R. Silva
Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). A