mirror of
https://github.com/torvalds/linux.git
synced 2026-09-26 10:02:02 +02:00
The trampoline reads the __arena flag from the btf_func_model per argument but stores the ctx one register slot at a time, so the two only line up if every preceding argument occupies exactly one slot. Every arena-bearing member of bpf_testmod_ops3 takes single-slot arguments, so nothing exercises the mapping and a mis-indexed arg_flags lookup would go unnoticed on any architecture. Add test_arena_multislot(), whose first argument is a 16-byte struct passed by value. It fills ctx[0] and ctx[1], putting the arena pointer at argument index one but slot two. The callback checks both halves of the struct before dereferencing ctx[2], so a JIT that walks registers instead of arguments converts the wrong slot and fails the test. Signed-off-by: Puranjay Mohan <puranjay@kernel.org> Acked-by: Xu Kuohai <xukuohai@huawei.com> Link: https://lore.kernel.org/bpf/20260813190356.335181-8-puranjay@kernel.org Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> |
||
|---|---|---|
| .. | ||
| .gitignore | ||
| bpf_test_modorder_x.c | ||
| bpf_test_modorder_y.c | ||
| bpf_test_no_cfi.c | ||
| bpf_test_rqspinlock.c | ||
| bpf_testmod_kfunc.h | ||
| bpf_testmod-events.h | ||
| bpf_testmod.c | ||
| bpf_testmod.h | ||
| Makefile | ||