aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/radix-tree/linux.c
diff options
context:
space:
mode:
authorJiri Olsa <olsajiri@gmail.com>2022-10-18 14:27:08 +0200
committerBorislav Petkov <bp@suse.de>2022-10-24 17:57:28 +0200
commit9440c42941606af4c379afa3cf8624f0dc43a629 (patch)
tree34cc85ed376aa6adbff3d4b56d6f0cd528340b2a /tools/testing/radix-tree/linux.c
parent247f34f7b80357943234f93f247a1ae6b6c3a740 (diff)
x86/syscall: Include asm/ptrace.h in syscall_wrapper header
With just the forward declaration of the 'struct pt_regs' in syscall_wrapper.h, the syscall stub functions: __[x64|ia32]_sys_*(struct pt_regs *regs) will have different definition of 'regs' argument in BTF data based on which object file they are defined in. If the syscall's object includes 'struct pt_regs' definition, the BTF argument data will point to a 'struct pt_regs' record, like: [226] STRUCT 'pt_regs' size=168 vlen=21 'r15' type_id=1 bits_offset=0 'r14' type_id=1 bits_offset=64 'r13' type_id=1 bits_offset=128 ... If not, it will point to a fwd declaration record: [15439] FWD 'pt_regs' fwd_kind=struct and make bpf tracing program hooking on those functions unable to access fields from 'struct pt_regs'. Include asm/ptrace.h directly in syscall_wrapper.h to make sure all syscalls see 'struct pt_regs' definition. This then results in BTF for '__*_sys_*(struct pt_regs *regs)' functions to point to the actual struct, not just the forward declaration. [ bp: No Fixes tag as this is not really a bug fix but "adjustment" so that BTF is happy. ] Reported-by: Akihiro HARAI <jharai0815@gmail.com> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Borislav Petkov <bp@suse.de> Acked-by: Andrii Nakryiko <andrii@kernel.org> Cc: <stable@vger.kernel.org> # this is needed only for BTF so kernels >= 5.15 Link: https://lore.kernel.org/r/20221018122708.823792-1-jolsa@kernel.org
Diffstat (limited to 'tools/testing/radix-tree/linux.c')
0 files changed, 0 insertions, 0 deletions