Skip to content

bpf: Reject arena frees below the arena base

Yiyang Chen bpf linux-kselftest lkml 2 versions – Applied

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

Get series with b4
b4 am 20260717-c10-031-public-bpf-next-v2-b4-v2-0-54b555443a7c@mails.tsinghua.edu.cn

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesApplied 2/2
  2. v12 patches 3 repliesSuperseded

Changes in v2 from the cover letter

- Add Reviewed-by tags from Emil Tsalapatis.
- Remove the empty inline asm from the selftest.

Patches in v2 All 2 applied

#Subject and filesSizeRepliesApplied
1/2bpf: Reject arena frees below the arena basekernel/bpf/arena.c+2 -00 repliesApplied
2/2selftests/bpf: Cover scalar arena frees below the basetools/testing/selftests/bpf/progs/verifier_arena.c+35 -50 repliesApplied

Reviews trailers per patch

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

PatchEmil Tsalapatis
1/2R-b
2/2R-b

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

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/2] bpf: Reject arena frees below the arena base

bpf_arena_free_pages() can be called with a scalar arena address. The runtime reconstructs a full user address from the arena base and the low 32 bits before returning the range to the arena free tree. A scalar one page below the arena base can otherwise produce an out-of-domain free-tree offset and make a later allocation return an address below the arena mapping.

Patch 1 rejects frees whose reconstructed full user address is below user_vm_start. Patch 2 adds verifier_arena coverage for the scalar-below-base case.

Changes in v2:
- Add Reviewed-by tags from Emil Tsalapatis.
- Remove the empty inline asm from the selftest.

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

Yiyang Chen (2):
bpf: Reject arena frees below the arena base selftests/bpf: Cover scalar arena frees below the base

 kernel/bpf/arena.c                                 |  2 ++
 tools/testing/selftests/bpf/progs/verifier_arena.c | 40 +++++++++++++++++++---
 2 files changed, 37 insertions(+), 5 deletions(-)

base-commit: 1d91ea01185656ac3ee63c5f9f6f8bde3c746b3d

Signature · 1 line
2.34.1