mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/2] bpf: Reject arena frees below the arena base
@ 2026-07-17 12:53 Yiyang Chen
  2026-07-17 12:53 ` [PATCH bpf-next v2 1/2] " Yiyang Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Yiyang Chen @ 2026-07-17 12:53 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Eduard Zingerman, Kumar Kartikeya Dwivedi
  Cc: Yiyang Chen, Martin KaFai Lau, Song Liu, Yonghong Song,
	Jiri Olsa, Shuah Khan, Emil Tsalapatis, Puranjay Mohan, bpf,
	linux-kselftest, linux-kernel

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/cover.1782813442.git.chenyy23@mails.tsinghua.edu.cn/

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
-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-19 16:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-17 12:53 [PATCH bpf-next v2 0/2] bpf: Reject arena frees below the arena base Yiyang Chen
2026-07-17 12:53 ` [PATCH bpf-next v2 1/2] " Yiyang Chen
2026-07-17 12:53 ` [PATCH bpf-next v2 2/2] selftests/bpf: Cover scalar arena frees below the base Yiyang Chen
2026-07-17 13:39   ` bot+bpf-ci
2026-07-19 16:30 ` [PATCH bpf-next v2 0/2] bpf: Reject arena frees below the arena base patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®