Skip to content

Ensure type tags are always ordered first in BTF

Kumar Kartikeya Dwivedi bpf 3 versions – Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 0 repliesApplied 2/2
  2. v22 patches 2 repliesSuperseded
  3. v12 patches 4 repliesSuperseded

Changes in v3 from the cover letter

v2: https://lore.kernel.org/bpf/[email protected]

* Address nit from Yonghong, add Acked-by

Patches in v3 All 2 applied

#Subject and filesSizeRepliesApplied
1/2bpf: Ensure type tags precede modifiers in BTFkernel/bpf/btf.c+54 -00 repliesApplied
2/2selftests/bpf: Add tests for type tag order validationtools/testing/selftests/bpf/prog_tests/btf.c+99 -00 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchYonghong Song
1/2A-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH bpf-next v3 0/2] Ensure type tags are always ordered first in BTF

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.

Changelog:
----------
v2 -> v3
v2: https://lore.kernel.org/bpf/[email protected]

* Address nit from Yonghong, add Acked-by

v1 -> v2
v1: https://lore.kernel.org/bpf/[email protected]

* Fix for bug pointed out by Yonghong
* Update selftests to include Yonghong's example

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                             | 54 +++++++++++
 tools/testing/selftests/bpf/prog_tests/btf.c | 99 ++++++++++++++++++++
 2 files changed, 153 insertions(+)
Signature · 1 line
2.35.1