summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2023-01-28 01:06:34 +0100
committerAlexei Starovoitov <ast@kernel.org>2023-01-28 12:30:09 -0800
commit207612eb12b912cad40c0299fefcabf3d6cc1f3f (patch)
treeb1c1a92098f121f0186cb45f762c20d7182a9142 /tools/testing/selftests/bpf/progs
parentbe6b5c10ecc4014446e5c807d6a69c5a7cc1c497 (diff)
downloadlinux-stable-207612eb12b912cad40c0299fefcabf3d6cc1f3f.tar.gz
linux-stable-207612eb12b912cad40c0299fefcabf3d6cc1f3f.tar.bz2
linux-stable-207612eb12b912cad40c0299fefcabf3d6cc1f3f.zip
selftests/bpf: Fix test_lsm on s390x
Use syscall macros to access the setdomainname() arguments; currently the code uses gprs[2] instead of orig_gpr2 for the first argument. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Link: https://lore.kernel.org/r/20230128000650.1516334-16-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/progs')
-rw-r--r--tools/testing/selftests/bpf/progs/lsm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/testing/selftests/bpf/progs/lsm.c b/tools/testing/selftests/bpf/progs/lsm.c
index d8d8af623bc2..dc93887ed34c 100644
--- a/tools/testing/selftests/bpf/progs/lsm.c
+++ b/tools/testing/selftests/bpf/progs/lsm.c
@@ -6,9 +6,10 @@
#include "bpf_misc.h"
#include "vmlinux.h"
+#include <bpf/bpf_core_read.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>
-#include <errno.h>
+#include <errno.h>
struct {
__uint(type, BPF_MAP_TYPE_ARRAY);
@@ -164,8 +165,8 @@ int copy_test = 0;
SEC("fentry.s/" SYS_PREFIX "sys_setdomainname")
int BPF_PROG(test_sys_setdomainname, struct pt_regs *regs)
{
- void *ptr = (void *)PT_REGS_PARM1(regs);
- int len = PT_REGS_PARM2(regs);
+ void *ptr = (void *)PT_REGS_PARM1_SYSCALL(regs);
+ int len = PT_REGS_PARM2_SYSCALL(regs);
int buf = 0;
long ret;