netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] net: dsa: felix: Annotate struct action_gate_entry with __counted_by
@ 2024-09-04  1:49 Hongbo Li
  2024-09-05 11:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Hongbo Li @ 2024-09-04  1:49 UTC (permalink / raw)
  To: vladimir.oltean, claudiu.manoil, alexandre.belloni, andrew,
	f.fainelli, davem, edumazet, kuba, pabeni, kees, gustavoars
  Cc: netdev, linux-hardening, lihongbo22

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

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 {
-- 
2.34.1


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

* Re: [PATCH -next] net: dsa: felix: Annotate struct action_gate_entry with __counted_by
  2024-09-04  1:49 [PATCH -next] net: dsa: felix: Annotate struct action_gate_entry with __counted_by Hongbo Li
@ 2024-09-05 11:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-09-05 11:30 UTC (permalink / raw)
  To: Hongbo Li
  Cc: vladimir.oltean, claudiu.manoil, alexandre.belloni, andrew,
	f.fainelli, davem, edumazet, kuba, pabeni, kees, gustavoars,
	netdev, linux-hardening

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!
-- 
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:[~2024-09-05 11:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-04  1:49 [PATCH -next] net: dsa: felix: Annotate struct action_gate_entry with __counted_by Hongbo Li
2024-09-05 11:30 ` patchwork-bot+netdevbpf

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