aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@linux.dev>2025-08-10 23:53:20 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2025-09-27 11:37:00 -0400
commitd4e99db3d942c8099006f3b7536bc52f766b475a (patch)
treed3639117352ba0e8e4328cdde6dadfe2a336d071
parentBluetooth: btintel_pcie: Define hdev->wakeup() callback (diff)
downloadlinux-d4e99db3d942c8099006f3b7536bc52f766b475a.tar.gz
linux-d4e99db3d942c8099006f3b7536bc52f766b475a.zip
Bluetooth: Annotate struct hci_drv_rp_read_info with __counted_by_le()
Add the __counted_by_le() compiler attribute to the flexible array member 'supported_commands' to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
-rw-r--r--include/net/bluetooth/hci_drv.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/bluetooth/hci_drv.h b/include/net/bluetooth/hci_drv.h
index 2f01c44f05ec..3fd6fdbdb02e 100644
--- a/include/net/bluetooth/hci_drv.h
+++ b/include/net/bluetooth/hci_drv.h
@@ -47,7 +47,7 @@ struct hci_drv_ev_cmd_complete {
struct hci_drv_rp_read_info {
__u8 driver_name[HCI_DRV_MAX_DRIVER_NAME_LENGTH];
__le16 num_supported_commands;
- __le16 supported_commands[];
+ __le16 supported_commands[] __counted_by_le(num_supported_commands);
} __packed;
/* Driver specific OGF (Opcode Group Field)