Files
linux/include/uapi/linux
Kees Cook 1e63e5a813 net: sched: Annotate struct tc_pedit 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).

As found with Coccinelle[1], add __counted_by for struct tc_pedit.
Additionally, since the element count member must be set before accessing
the annotated flexible array member, move its initialization earlier.

Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1]
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-02-19 10:58:24 +00:00
..
2023-05-14 16:05:28 +01:00
2023-05-30 15:20:08 +01:00
2022-08-11 10:31:19 -07:00
2022-06-07 10:20:42 -07:00
2023-12-07 12:44:19 -08:00
2023-01-20 09:33:22 +00:00
2023-03-06 15:49:07 -06:00
2023-09-24 18:17:31 -07:00
2023-03-16 21:20:32 -07:00
2023-09-21 19:22:05 +02:00
2022-08-10 13:49:50 +01:00
2023-10-24 12:02:02 +02:00
2022-09-20 09:13:38 +02:00
2023-12-15 17:01:30 +01:00
2023-06-09 16:25:16 -07:00
2023-12-14 11:49:17 +01:00
2023-04-27 19:15:11 -06:00
2022-09-07 16:46:03 +02:00
2023-11-28 19:05:16 +00:00
2023-10-28 13:31:05 -05:00
2023-12-20 19:26:31 -05:00
2023-11-18 14:56:16 +01:00
2023-10-27 10:35:46 +01:00
2022-11-17 11:04:23 -08:00
2022-09-27 17:29:09 -07:00
2023-06-05 09:36:35 +02:00
2023-12-29 11:58:24 -08:00
2023-03-23 17:25:46 +01:00