From: Zbigniew Jędrzejewski-Szmek Date: Tue, 18 Aug 2020 14:10:47 +0000 (+0200) Subject: shared/seccomp: do not use ifdef guards around textual syscall names X-Git-Tag: v247-rc1~401^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6da432fd542af5553742b905a0f87a825a28a399;p=thirdparty%2Fsystemd.git shared/seccomp: do not use ifdef guards around textual syscall names It is possible that we will be running with an upgraded libseccomp, in which case libseccomp might know the syscall name, even if the number is not known at the time when systemd is being compiled. The guard only serves to break such upgrades, by requiring that we also recompile systemd. For s390-specific syscalls, use a define to exclude them, so that that we don't try to filter them on other arches. (cherry picked from commit 6cf852e79eb0eced2f77653941f9c75c3bd79386) --- diff --git a/src/shared/seccomp-util.c b/src/shared/seccomp-util.c index 45bf309bcf8..99585924a0e 100644 --- a/src/shared/seccomp-util.c +++ b/src/shared/seccomp-util.c @@ -387,7 +387,7 @@ const SyscallFilterSet syscall_filter_sets[_SYSCALL_FILTER_SET_MAX] = { "pidfd_getfd\0" "ptrace\0" "rtas\0" -#ifdef __NR_s390_runtime_instr +#if defined __s390__ || defined __s390x__ "s390_runtime_instr\0" #endif "sys_debug_setcontext\0" @@ -464,9 +464,7 @@ const SyscallFilterSet syscall_filter_sets[_SYSCALL_FILTER_SET_MAX] = { "stat64\0" "statfs\0" "statfs64\0" -#ifdef __NR_statx "statx\0" -#endif "symlink\0" "symlinkat\0" "truncate\0" @@ -712,10 +710,8 @@ const SyscallFilterSet syscall_filter_sets[_SYSCALL_FILTER_SET_MAX] = { "pciconfig_iobase\0" "pciconfig_read\0" "pciconfig_write\0" -#ifdef __NR_s390_pci_mmio_read +#if defined __s390__ || defined __s390x__ "s390_pci_mmio_read\0" -#endif -#ifdef __NR_s390_pci_mmio_write "s390_pci_mmio_write\0" #endif },