Skip to content

Add missing size check for BTF-based ctx access

Kumar Kartikeya Dwivedi bpf 1 version Applied

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

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2bpf: Check size for BTF-based ctx access of pointer memberskernel/bpf/btf.c tools/testing/selftests/bpf/progs/verifier_btf_ctx_access.c tools/testing/selftests/bpf/progs/verifier_d_path.c+10 -41 replyApplied
2/2selftests/bpf: Add test for narrow ctx load for pointer argstools/testing/selftests/bpf/progs/verifier_btf_ctx_access.c+36 -00 repliesApplied

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchEduard Zingerman
1/2A-b
2/2

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

Read the v1 thread

Cover letter [PATCH bpf v1 0/2] Add missing size check for BTF-based ctx access

This set fixes a issue reported for tracing and struct ops programs using btf_ctx_access for ctx checks, where loading a pointer argument from the ctx doesn't enforce a BPF_DW access size check. The original report is at link [0]. Also add a regression test along with the fix.

[0]: https://lore.kernel.org/bpf/51338.1732985814@localhost

Kumar Kartikeya Dwivedi (2):
bpf: Check size for BTF-based ctx access of pointer members selftests/bpf: Add test for narrow ctx load for pointer args

 kernel/bpf/btf.c                              |  6 +++
 .../bpf/progs/verifier_btf_ctx_access.c       | 40 ++++++++++++++++++-
 .../selftests/bpf/progs/verifier_d_path.c     |  4 +-
 3 files changed, 46 insertions(+), 4 deletions(-)

base-commit: 7d0d673627e20cfa3b21a829a896ce03b58a4f1c

Signature · 1 line
2.43.5