diff mbox series

[-next] net: dsa: felix: Annotate struct action_gate_entry with __counted_by

Message ID 20240904014956.2035117-1-lihongbo22@huawei.com (mailing list archive)
State Mainlined
Commit 50ddaedeae7562b25e8eeca04f581d7c815be1db
Headers show
Series [-next] net: dsa: felix: Annotate struct action_gate_entry with __counted_by | expand

Commit Message

Hongbo Li Sept. 4, 2024, 1:49 a.m. UTC
Add the __counted_by compiler attribute to the flexible array member
entries to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
---
 drivers/net/dsa/ocelot/felix_vsc9959.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org Sept. 5, 2024, 11:30 a.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Wed, 4 Sep 2024 09:49:56 +0800 you wrote:
> Add the __counted_by compiler attribute to the flexible array member
> entries to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
> CONFIG_FORTIFY_SOURCE.
> 
> Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
> ---
>  drivers/net/dsa/ocelot/felix_vsc9959.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [-next] net: dsa: felix: Annotate struct action_gate_entry with __counted_by
    https://git.kernel.org/netdev/net-next/c/50ddaedeae75

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c
index ba37a566da39..73d053501fb1 100644
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
@@ -1733,7 +1733,7 @@  struct felix_stream_gate {
 	u64 cycletime;
 	u64 cycletime_ext;
 	u32 num_entries;
-	struct action_gate_entry entries[];
+	struct action_gate_entry entries[] __counted_by(num_entries);
 };
 
 struct felix_stream_gate_entry {