diff options
author | Hongbo Li <lihongbo22@huawei.com> | 2024-09-04 03:49:56 +0200 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2024-09-05 13:01:01 +0200 |
commit | 50ddaedeae7562b25e8eeca04f581d7c815be1db (patch) | |
tree | 4bbe682987f676e1ddf0a30ab06e9b38ea23ecbb | |
parent | Merge branch 'bonding-support-new-xfrm-state-offload-functions' (diff) | |
download | linux-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.c | 2 |
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 { |