netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Annotate struct hci_drv_rp_read_info with __counted_by_le()
@ 2025-08-10 21:53 Thorsten Blum
  2025-08-11 16:16 ` patchwork-bot+bluetooth
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2025-08-10 21:53 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Kees Cook, Gustavo A. R. Silva
  Cc: Thorsten Blum, linux-bluetooth, netdev, linux-kernel,
	linux-hardening

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>
---
 include/net/bluetooth/hci_drv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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)
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: Annotate struct hci_drv_rp_read_info with __counted_by_le()
  2025-08-10 21:53 [PATCH] Bluetooth: Annotate struct hci_drv_rp_read_info with __counted_by_le() Thorsten Blum
@ 2025-08-11 16:16 ` patchwork-bot+bluetooth
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+bluetooth @ 2025-08-11 16:16 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: marcel, johan.hedberg, luiz.dentz, davem, edumazet, kuba, pabeni,
	horms, kees, gustavoars, linux-bluetooth, netdev, linux-kernel,
	linux-hardening

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Sun, 10 Aug 2025 23:53:20 +0200 you wrote:
> 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>
> ---
>  include/net/bluetooth/hci_drv.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - Bluetooth: Annotate struct hci_drv_rp_read_info with __counted_by_le()
    https://git.kernel.org/bluetooth/bluetooth-next/c/af4ae40b525d

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-11 16:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-10 21:53 [PATCH] Bluetooth: Annotate struct hci_drv_rp_read_info with __counted_by_le() Thorsten Blum
2025-08-11 16:16 ` patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).