Skip to content

Commit

Permalink
net: dsa: felix: Annotate struct action_gate_entry with __counted_by
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hongbo Li authored and Paolo Abeni committed Sep 5, 2024
1 parent ed42b2b commit 50ddaed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/dsa/ocelot/felix_vsc9959.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 50ddaed

Please sign in to comment.