summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHongbo Li <lihongbo22@huawei.com>2024-09-04 03:49:56 +0200
committerPaolo Abeni <pabeni@redhat.com>2024-09-05 13:01:01 +0200
commit50ddaedeae7562b25e8eeca04f581d7c815be1db (patch)
tree4bbe682987f676e1ddf0a30ab06e9b38ea23ecbb
parentMerge branch 'bonding-support-new-xfrm-state-offload-functions' (diff)
downloadlinux-50ddaedeae7562b25e8eeca04f581d7c815be1db.tar.xz
linux-50ddaedeae7562b25e8eeca04f581d7c815be1db.zip
net: dsa: felix: Annotate struct action_gate_entry with __counted_by
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> Link: https://patch.msgid.link/20240904014956.2035117-1-lihongbo22@huawei.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-rw-r--r--drivers/net/dsa/ocelot/felix_vsc9959.c2
1 files changed, 1 insertions, 1 deletions
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 {