mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH bpf v3 0/2] bpf: bound arena allocations to the user VMA
@ 2026-11-22 11:28 YanXin Li via B4 Relay
  2026-11-22 11:28 ` [PATCH bpf v3 1/2] " YanXin Li via B4 Relay
  2026-11-22 11:28 ` [PATCH bpf v3 2/2] selftests/bpf: test arena allocation after a short mmap YanXin Li via B4 Relay
  0 siblings, 2 replies; 4+ messages in thread
From: YanXin Li via B4 Relay @ 2026-11-22 11:28 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Eduard Zingerman, Kumar Kartikeya Dwivedi
  Cc: Martin KaFai Lau, Song Liu, Yonghong Song, Jiri Olsa,
	Emil Tsalapatis, Ihor Solodrai, bpf, linux-kernel, stable

When map_extra is omitted, a short first mmap() can leave free arena
pages beyond the user VMA. Automatic allocation can select those pages;
near a 4 GiB boundary, the kernel mapping can extend past the arena's
vmalloc reservation. Patch 1 confines the range tree to the VMA, and
patch 2 adds a regression selftest.

---
Changes in v3:
- Correct the 288-page boundary calculation and describe the vmalloc guard.
- Distinguish out-of-VMA allocations from 32-bit wrap and limit claims to
  what the local test establishes.
- Remove the unreachable arena_adjust_tree() bound check.
- Point Fixes at the range-tree conversion and identify the test commit.
- Split the regression selftest into patch 2/2 and skip it when arena
  program loading returns -EOPNOTSUPP with JIT disabled.
- Link to v2: https://lore.kernel.org/r/20261122-b4-03-bpf-arena-vmalloc-oob-v2-5f6209c1a20e-v2-1-b2a9906e9676@pm.me

---
YanXin Li (2):
      bpf: bound arena allocations to the user VMA
      selftests/bpf: test arena allocation after a short mmap

 kernel/bpf/arena.c                                 | 25 ++++++++++
 .../testing/selftests/bpf/prog_tests/arena_mmap.c  | 53 ++++++++++++++++++++++
 .../testing/selftests/bpf/progs/arena_mmap_alloc.c | 32 +++++++++++++
 3 files changed, 110 insertions(+)
---
base-commit: c44104f3642da720164042623e4832836aefdd8e
change-id: 20261122-b4-03-bpf-arena-vmalloc-oob-v3-da2dc21683c6-16baca6b3f21

Best regards,
--  
YanXin Li <fadouse@pm.me>



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

end of thread, other threads:[~2026-11-22 12:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-22 11:28 [PATCH bpf v3 0/2] bpf: bound arena allocations to the user VMA YanXin Li via B4 Relay
2026-11-22 11:28 ` [PATCH bpf v3 1/2] " YanXin Li via B4 Relay
2026-11-22 11:28 ` [PATCH bpf v3 2/2] selftests/bpf: test arena allocation after a short mmap YanXin Li via B4 Relay
2026-11-22 12:11   ` bot+bpf-ci

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®