Commit 7713ec84 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Paolo Abeni
Browse files

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/ca5c8049f58bb933f231afd0816e30a5aaa0eddd.1697264974.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent df3bf90f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ struct mask_array {
	int count, max;
	struct mask_array_stats __percpu *masks_usage_stats;
	u64 *masks_usage_zero_cntr;
	struct sw_flow_mask __rcu *masks[];
	struct sw_flow_mask __rcu *masks[] __counted_by(max);
};

struct table_instance {