All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next v1 0/2] Ensure type tags are always ordered first in BTF
@ 2022-04-06  0:41 Kumar Kartikeya Dwivedi
  2022-04-06  0:41 ` [PATCH bpf-next v1 1/2] bpf: Ensure type tags precede modifiers " Kumar Kartikeya Dwivedi
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Kumar Kartikeya Dwivedi @ 2022-04-06  0:41 UTC (permalink / raw)
  To: bpf; +Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann

When iterating over modifiers, ensure that type tags can only occur at head of
the chain, and don't occur later, such that checking for them once in the start
tells us there are no more type tags in later modifiers. Clang already ensures
to emit such BTF, but user can craft their own BTF which violates such
assumptions if relied upon in the kernel.

Kumar Kartikeya Dwivedi (2):
  bpf: Ensure type tags precede modifiers in BTF
  selftests/bpf: Add tests for type tag order validation

 kernel/bpf/btf.c                             | 51 +++++++++++++
 tools/testing/selftests/bpf/prog_tests/btf.c | 77 ++++++++++++++++++++
 2 files changed, 128 insertions(+)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-04-18 22:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-06  0:41 [PATCH bpf-next v1 0/2] Ensure type tags are always ordered first in BTF Kumar Kartikeya Dwivedi
2022-04-06  0:41 ` [PATCH bpf-next v1 1/2] bpf: Ensure type tags precede modifiers " Kumar Kartikeya Dwivedi
2022-04-18 19:53   ` Yonghong Song
2022-04-18 20:31     ` Kumar Kartikeya Dwivedi
2022-04-18 22:22       ` Yonghong Song
2022-04-06  0:41 ` [PATCH bpf-next v1 2/2] selftests/bpf: Add tests for type tag order validation Kumar Kartikeya Dwivedi
2022-04-13  3:23 ` [PATCH bpf-next v1 0/2] Ensure type tags are always ordered first in BTF Andrii Nakryiko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.