[PATCH bpf 2/7] bpf/x86: prevent trampoline attachment when args location on stack is uncertain

2025-06-13 Thread eBPF Foundation
max bpf args check in the new function. Fixes: 473e3150e30a ("bpf, x86: allow function arguments up to 12 for TRACING") Signed-off-by: Alexis Lothoré (eBPF Foundation) --- arch/x86/net/bpf_jit_comp.c | 36 ++-- 1 file changed, 30 insertions(+), 6 deletion

[PATCH bpf 1/7] bpf/x86: use define for max regs count used for arguments

2025-06-13 Thread eBPF Foundation
x86 allows using up to 6 registers to pass arguments between function calls. This value is hardcoded in multiple places, use a define for this value. Signed-off-by: Alexis Lothoré (eBPF Foundation) --- arch/x86/net/bpf_jit_comp.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions

[PATCH bpf 5/7] bpf/powerpc64: use define for max regs count used for arguments

2025-06-13 Thread eBPF Foundation
powerpc allows using up to 8 registers to pass arguments between function calls. This value is hardcoded in multiple places, use a define for this value. Signed-off-by: Alexis Lothoré (eBPF Foundation) --- arch/powerpc/net/bpf_jit_comp.c | 10 +++--- 1 file changed, 7 insertions(+), 3

[PATCH bpf 3/7] bpf/riscv: prevent trampoline attachment when args location on stack is uncertain

2025-06-13 Thread eBPF Foundation
max bpf args check in the new function. Fixes: 6801b0aef79d ("riscv, bpf: Add 12-argument support for RV64 bpf trampoline") Signed-off-by: Alexis Lothoré (eBPF Foundation) --- arch/riscv/net/bpf_jit_comp64.c | 26 -- 1 file changed, 24 insertions(+), 2 deletion

[PATCH bpf 7/7] selftests/bpf: ensure that functions passing structs on stack can not be hooked

2025-06-13 Thread eBPF Foundation
arguments on stack (-> more than 8 args) Signed-off-by: Alexis Lothoré (eBPF Foundation) --- .../selftests/bpf/prog_tests/tracing_struct.c | 37 +--- .../selftests/bpf/progs/tracing_struct_many_args.c | 70 -- .../testing/selftests/bpf/test_kmods/bpf_testmod.c |

[PATCH bpf 6/7] bpf/powerpc64: prevent trampoline attachment when args location on stack is uncertain

2025-06-13 Thread eBPF Foundation
max bpf args check in the new function. Fixes: d243b62b7bd3 ("powerpc64/bpf: Add support for bpf trampolines") Signed-off-by: Alexis Lothoré (eBPF Foundation) --- arch/powerpc/net/bpf_jit_comp.c | 28 +--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --

[PATCH bpf 4/7] bpf/s390: prevent trampoline attachment when args location on stack is uncertain

2025-06-13 Thread eBPF Foundation
the existing check (ensuring that the number of args passed on stack is not higher than MAX_NR_STACK_ARGS) into the newly created check function. Fixes: 528eb2cb87bc ("s390/bpf: Implement arch_prepare_bpf_trampoline()") Signed-off-by: Alexis Lothoré (eBPF Foundation) --- arc

[PATCH bpf 0/7] bpf: deny trampoline attachment if args can not be located exactly on stack

2025-06-13 Thread eBPF Foundation
-many_args_arm64-v1-0-0a32fe723...@bootlin.com/ [2] https://lore.kernel.org/bpf/caadnvqkr3ftnt1uqvrxbe0a2o37zyro2phqcohunw6pe5t2...@mail.gmail.com/ Signed-off-by: Alexis Lothoré (eBPF Foundation) --- Alexis Lothoré (eBPF Foundation) (7): bpf/x86: use define for max regs count used for