Skip to content

Misc bug fixes - part 3

Kumar Kartikeya Dwivedi bpf 2 versions 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 · linked by author and title

  1. v2 Latest8 patches 0 repliesApplied 8/8
  2. v18 patches 0 repliesSuperseded

Changes in v2 from the cover letter

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

* Fix GCC-BPF failure due to missed BTF emission for a type.

Patches in v2 All 8 applied

#Subject and filesSizeRepliesApplied
1/8bpf: Require MEM_PERCPU for percpu kptr storeskernel/bpf/verifier.c+7 -00 repliesApplied
2/8selftests/bpf: Reject non-percpu values in percpu kptr fieldstools/testing/selftests/bpf/progs/percpu_alloc_fail.c+59 -00 repliesApplied
3/8bpf: Keep refcount_acquire nullable for borrowed RCU kptrskernel/bpf/verifier.c+1 -10 repliesApplied
4/8selftests/bpf: Test borrowed refcount acquisition nullabilitytools/testing/selftests/bpf/progs/refcounted_kptr.c tools/testing/selftests/bpf/progs/refcounted_kptr_fail.c+109 -00 repliesApplied
5/8bpf: Clear NON_OWN_REF after RCU protection endskernel/bpf/verifier.c+14 -40 repliesApplied
6/8selftests/bpf: Reject graph kptr use after RCU unlocktools/testing/selftests/bpf/progs/rcu_read_lock.c tools/testing/selftests/bpf/progs/refcounted_kptr_fail.c+78 -30 repliesApplied
7/8bpf: Reject untrusted allocated-object pointersinclude/linux/bpf_verifier.h+3 -10 repliesApplied
8/8selftests/bpf: Reject refcount acquisition after RCU unlocktools/testing/selftests/bpf/progs/refcounted_kptr_fail.c+27 -00 repliesApplied

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH bpf v2 0/8] Misc bug fixes - part 3

A set of miscellaneous fixes for bugs reported by Nicholas, batched together again. See commit logs for details. Some of this was caught and posted by Ning before, but AI raised some concerns, so I'm resolving those issues and commandeering their patches now.

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

* Fix GCC-BPF failure due to missed BTF emission for a type.

Kumar Kartikeya Dwivedi (4):
bpf: Require MEM_PERCPU for percpu kptr stores selftests/bpf: Reject non-percpu values in percpu kptr fields
bpf: Clear NON_OWN_REF after RCU protection ends selftests/bpf: Reject graph kptr use after RCU unlock

Ning Ding (4):
bpf: Keep refcount_acquire nullable for borrowed RCU kptrs selftests/bpf: Test borrowed refcount acquisition nullability
bpf: Reject untrusted allocated-object pointers selftests/bpf: Reject refcount acquisition after RCU unlock

 include/linux/bpf_verifier.h                  |   4 +-
 kernel/bpf/verifier.c                         |  27 +++-
 .../selftests/bpf/progs/percpu_alloc_fail.c   |  59 +++++++
 .../selftests/bpf/progs/rcu_read_lock.c       |   6 +-
 .../selftests/bpf/progs/refcounted_kptr.c     |  61 +++++++
 .../bpf/progs/refcounted_kptr_fail.c          | 150 ++++++++++++++++++
 6 files changed, 298 insertions(+), 9 deletions(-)

base-commit: 254c881fe0554c5efb16d355c273702a27a32a20

Signature · 1 line
2.53.0