From: Thorsten Blum Date: Sun, 10 Aug 2025 21:53:20 +0000 (+0200) Subject: Bluetooth: Annotate struct hci_drv_rp_read_info with __counted_by_le() X-Git-Tag: v6.18-rc1~132^2~26^2~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d4e99db3d942c8099006f3b7536bc52f766b475a;p=thirdparty%2Fkernel%2Fstable.git 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 Signed-off-by: Luiz Augusto von Dentz --- diff --git a/include/net/bluetooth/hci_drv.h b/include/net/bluetooth/hci_drv.h index 2f01c44f05ec2..3fd6fdbdb02e8 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)