]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
seccomp: drop per arch conditionalization in filter groups
authorLennart Poettering <lennart@poettering.net>
Fri, 14 Oct 2022 16:02:31 +0000 (18:02 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 14 Oct 2022 22:00:16 +0000 (00:00 +0200)
We list plenty of arch-specific syscalls in our filter groups, treat the
s390 syscalls the same.

We handle gracefully anyway if some syscall doesn't exist locally on the
kernel or arch, let's rely on it. This has the benefit that
"systemd-analyze" will comprehensively tell you the syscalls filtered on
any arch for any arch.

And less conditionalization is good anyway.

src/shared/seccomp-util.c

index 52ee315dda782bb13b0ab4f9e002433028741011..1247da535d050603927519797acec9c054147b92 100644 (file)
@@ -447,9 +447,7 @@ const SyscallFilterSet syscall_filter_sets[_SYSCALL_FILTER_SET_MAX] = {
                 "pidfd_getfd\0"
                 "ptrace\0"
                 "rtas\0"
-#if defined __s390__ || defined __s390x__
                 "s390_runtime_instr\0"
-#endif
                 "sys_debug_setcontext\0"
         },
         [SYSCALL_FILTER_SET_FILE_SYSTEM] = {
@@ -773,10 +771,8 @@ const SyscallFilterSet syscall_filter_sets[_SYSCALL_FILTER_SET_MAX] = {
                 "pciconfig_iobase\0"
                 "pciconfig_read\0"
                 "pciconfig_write\0"
-#if defined __s390__ || defined __s390x__
                 "s390_pci_mmio_read\0"
                 "s390_pci_mmio_write\0"
-#endif
         },
         [SYSCALL_FILTER_SET_REBOOT] = {
                 .name = "@reboot",