Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Fix attach point for non-x86 arches in test_progs/lsm

Use SYS_PREFIX macro from bpf_misc.h instead of hard-coded '__x64_'
prefix for sys_setdomainname attach point in lsm test.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220816055231.717006-1-asavkov@redhat.com

authored by

Artem Savkov and committed by
Andrii Nakryiko
807662ca 1f235777

+3 -2
+1 -1
tools/testing/selftests/bpf/DENYLIST.s390x
··· 43 43 test_bprm_opts # failed to auto-attach program 'secure_exec': -524 (trampoline) 44 44 test_ima # failed to auto-attach program 'ima': -524 (trampoline) 45 45 test_local_storage # failed to auto-attach program 'unlink_hook': -524 (trampoline) 46 - test_lsm # failed to find kernel BTF type ID of '__x64_sys_setdomainname': -3 (?) 46 + test_lsm # attach unexpected error: -524 (trampoline) 47 47 test_overhead # attach_fentry unexpected error: -524 (trampoline) 48 48 test_profiler # unknown func bpf_probe_read_str#45 (overlapping) 49 49 timer # failed to auto-attach program 'test1': -524 (trampoline)
+2 -1
tools/testing/selftests/bpf/progs/lsm.c
··· 4 4 * Copyright 2020 Google LLC. 5 5 */ 6 6 7 + #include "bpf_misc.h" 7 8 #include "vmlinux.h" 8 9 #include <bpf/bpf_helpers.h> 9 10 #include <bpf/bpf_tracing.h> ··· 161 160 162 161 int copy_test = 0; 163 162 164 - SEC("fentry.s/__x64_sys_setdomainname") 163 + SEC("fentry.s/" SYS_PREFIX "sys_setdomainname") 165 164 int BPF_PROG(test_sys_setdomainname, struct pt_regs *regs) 166 165 { 167 166 void *ptr = (void *)PT_REGS_PARM1(regs);