linux-stable/include/uapi/linux/tc_act
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
..
tc_bpf.h headers: Remove some left-over license text 2022-09-27 07:48:01 -07:00
tc_connmark.h net: Move all TC actions identifiers to one place 2019-02-10 09:28:43 -08:00
tc_csum.h net: Move all TC actions identifiers to one place 2019-02-10 09:28:43 -08:00
tc_ct.h net: sched: add helper support in act_ct 2022-11-08 12:15:19 +01:00
tc_ctinfo.h net: sched: act_ctinfo: tidy UAPI definition 2019-06-19 17:11:01 -04:00
tc_defact.h License cleanup: add SPDX license identifier to uapi header files with no license 2017-11-02 11:19:54 +01:00
tc_gact.h net: Move all TC actions identifiers to one place 2019-02-10 09:28:43 -08:00
tc_gate.h net: qos: introduce a gate control flow action 2020-05-01 16:08:19 -07:00
tc_ife.h net: Move all TC actions identifiers to one place 2019-02-10 09:28:43 -08:00
tc_mirred.h net/sched: act_mirred: Allow mirred to block 2023-12-26 21:20:09 +00:00
tc_mpls.h net/sched: act_mpls: Add action to push MPLS LSE before Ethernet header 2020-10-03 17:28:45 -07:00
tc_nat.h net: Move all TC actions identifiers to one place 2019-02-10 09:28:43 -08:00
tc_pedit.h net: sched: Annotate struct tc_pedit with __counted_by 2024-02-19 10:58:24 +00:00
tc_sample.h net: Move all TC actions identifiers to one place 2019-02-10 09:28:43 -08:00
tc_skbedit.h headers: Remove some left-over license text 2022-09-27 07:48:01 -07:00
tc_skbmod.h headers: Remove some left-over license text 2022-09-27 07:48:01 -07:00
tc_tunnel_key.h net/sched: act_tunnel_key: add support for "don't fragment" 2023-03-30 23:24:24 -07:00
tc_vlan.h headers: Remove some left-over license text 2022-09-27 07:48:01 -07:00