selftests/bpf: Use PT_REGS_SYSCALL_REGS in bpf_syscall_macro
authorIlya Leoshkevich <iii@linux.ibm.com>
Wed, 9 Feb 2022 02:17:38 +0000 (03:17 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 9 Feb 2022 05:16:14 +0000 (21:16 -0800)
Ensure that PT_REGS_SYSCALL_REGS works correctly.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220209021745.2215452-4-iii@linux.ibm.com
tools/testing/selftests/bpf/progs/bpf_syscall_macro.c

index f5c6ef2ff6d18867ed20c213792373f6426d0ebd..e7c622cb6a391b9cc2fa3bd7df1cb5fe9cb072ce 100644 (file)
@@ -33,7 +33,7 @@ int BPF_KPROBE(handle_sys_prctl)
        if (pid != filter_pid)
                return 0;
 
-       real_regs = (struct pt_regs *)PT_REGS_PARM1(ctx);
+       real_regs = PT_REGS_SYSCALL_REGS(ctx);
 
        /* test for PT_REGS_PARM */