Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: openvswitch: Annotate struct mask_array with __counted_by

Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
(for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/ca5c8049f58bb933f231afd0816e30a5aaa0eddd.1697264974.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Christophe JAILLET and committed by
Paolo Abeni
7713ec84 df3bf90f

+1 -1
+1 -1
net/openvswitch/flow_table.h
··· 48 48 int count, max; 49 49 struct mask_array_stats __percpu *masks_usage_stats; 50 50 u64 *masks_usage_zero_cntr; 51 - struct sw_flow_mask __rcu *masks[]; 51 + struct sw_flow_mask __rcu *masks[] __counted_by(max); 52 52 }; 53 53 54 54 struct table_instance {