From: Kuniyuki Iwashima Date: Mon, 31 Oct 2022 21:57:28 +0000 (-0700) Subject: arm64/syscall: Include asm/ptrace.h in syscall_wrapper header. X-Git-Tag: baikal/mips/sdk5.8.2~1809 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=e8fb7b85e4e3539ffe1d23898273111052e2fa56;p=kernel.git arm64/syscall: Include asm/ptrace.h in syscall_wrapper header. [ Upstream commit 29ed33ef89c85fcde2ca640b323972e098f589c9 ] Add the same change for ARM64 as done in the commit 33ed529a3375 ("x86/syscall: Include asm/ptrace.h in syscall_wrapper header") to make sure all syscalls see 'struct pt_regs' definition and resulted BTF for '__arm64_sys_*(struct pt_regs *regs)' functions point to actual struct. Without this patch, the BPF verifier refuses to load a tracing prog which accesses pt_regs. bpf(BPF_PROG_LOAD, {prog_type=0x1a, ...}, 128) = -1 EACCES With this patch, we can see the correct error, which saves us time in debugging the prog. bpf(BPF_PROG_LOAD, {prog_type=0x1a, ...}, 128) = 4 bpf(BPF_RAW_TRACEPOINT_OPEN, {raw_tracepoint={name=NULL, prog_fd=4}}, 128) = -1 ENOTSUPP Signed-off-by: Kuniyuki Iwashima Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20221031215728.50389-1-kuniyu@amazon.com Signed-off-by: Catalin Marinas Signed-off-by: Sasha Levin --- diff --git a/arch/arm64/include/asm/syscall_wrapper.h b/arch/arm64/include/asm/syscall_wrapper.h index 06d880b3526c3..43a20888bf19a 100644 --- a/arch/arm64/include/asm/syscall_wrapper.h +++ b/arch/arm64/include/asm/syscall_wrapper.h @@ -8,7 +8,7 @@ #ifndef __ASM_SYSCALL_WRAPPER_H #define __ASM_SYSCALL_WRAPPER_H -struct pt_regs; +#include #define SC_ARM64_REGS_TO_ARGS(x, ...) \ __MAP(x,__SC_ARGS \