Skip to content

bpf: Introduce union trusted

Yafang Shao bpf 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesIn review

Changes from the cover letter

- bpf: Fix errors in verifying a union
https://lore.kernel.org/bpf/[email protected]/

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3bpf: Introduce BTF_TYPE_SAFE_TRUSTED_UNIONkernel/bpf/btf.c kernel/bpf/verifier.c+30 -114 replies
2/3selftests/bpf: Add selftests for BTF_TYPE_SAFE_TRUSTED_UNIONtools/testing/selftests/bpf/progs/nested_trust_failure.c tools/testing/selftests/bpf/progs/nested_trust_success.c+31 -00 replies
3/3bpf: Fix an error in verifying a field in a unionkernel/bpf/btf.c+1 -12 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH bpf-next 0/3] bpf: Introduce union trusted

When we are verifying a field in a union, we may verify another field which has the same offset. So we should annotate that field as untrusted. In some cases we have already known that some fields are safe and then we can add them into the union trusted allow list.

Patch #3 fixes an issue found in our dev server.

Changes:
- bpf: Fix errors in verifying a union
https://lore.kernel.org/bpf/[email protected]/

Yafang Shao (3):
bpf: Introduce BTF_TYPE_SAFE_TRUSTED_UNION selftests/bpf: Add selftests for BTF_TYPE_SAFE_TRUSTED_UNION
bpf: Fix an error in verifying a field in a union

 kernel/bpf/btf.c                              | 22 +++++++++----------
 kernel/bpf/verifier.c                         | 21 ++++++++++++++++++
 .../bpf/progs/nested_trust_failure.c          | 16 ++++++++++++++
 .../bpf/progs/nested_trust_success.c          | 15 +++++++++++++
 4 files changed, 62 insertions(+), 12 deletions(-)
Signature · 1 line
2.30.1 (Apple Git-130)