]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf: Report arena faults to BPF stderr
authorPuranjay Mohan <puranjay@kernel.org>
Thu, 11 Sep 2025 14:58:02 +0000 (14:58 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 11 Sep 2025 20:00:43 +0000 (13:00 -0700)
commit5c5240d020615f13331f4e2c559186125eddc7d3
tree1ac05dc3c118da75f84157a901db116d17088b13
parent70f23546d246563da648baedbb0432ba1d6bb357
bpf: Report arena faults to BPF stderr

Begin reporting arena page faults and the faulting address to BPF
program's stderr, this patch adds support in the arm64 and x86-64 JITs,
support for other archs can be added later.

The fault handlers receive the 32 bit address in the arena region so
the upper 32 bits of user_vm_start is added to it before printing the
address. This is what the user would expect to see as this is what is
printed by bpf_printk() is you pass it an address returned by
bpf_arena_alloc_pages();

Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20250911145808.58042-4-puranjay@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
arch/arm64/net/bpf_jit_comp.c
arch/x86/net/bpf_jit_comp.c
include/linux/bpf.h
kernel/bpf/arena.c