]> git.proxmox.com Git - swtpm.git/blobdiff - src/swtpm/seccomp_profile.c
swtpm: Check for defined __SNR_MOUNT_setattr and __NR_mount_setattr
[swtpm.git] / src / swtpm / seccomp_profile.c
index df27b2de98f3022e53e41d2b2a6990df051817c2..7299b89d9284911c42f6b941ae23290b2772c60e 100644 (file)
@@ -91,38 +91,32 @@ int create_seccomp_profile(bool cusetpm, unsigned int action)
         SCMP_SYS(settimeofday),
         SCMP_SYS(clock_adjtime),
         SCMP_SYS(clock_settime),
-#ifdef __NR_clock_settime64
+#ifdef __SNR_clock_settime64
         SCMP_SYS(clock_settime64),
 #endif
         SCMP_SYS(adjtimex),
-#ifdef __NR_fsopen
+#ifdef __SNR_fsopen
         SCMP_SYS(fsopen),
 #endif
-#ifdef __NR_fsconfig
+#ifdef __SNR_fsconfig
         SCMP_SYS(fsconfig),
 #endif
-#ifdef __NR_fsmount
-        SCMP_SYS(fs_mount),
+#ifdef __SNR_fsmount
+        SCMP_SYS(fsmount),
 #endif
-#ifdef __NR_fspick
+#ifdef __SNR_fspick
         SCMP_SYS(fspick),
 #endif
         SCMP_SYS(mount),
-#ifdef __NR_move_mount
+#ifdef __SNR_move_mount
         SCMP_SYS(move_mount),
 #endif
-#ifdef __NR_mount_setattr
+#if defined(__SNR_mount_setattr) && defined(__NR_mount_setattr)
         SCMP_SYS(mount_setattr),
 #endif
         SCMP_SYS(umount2),
-#ifdef __NR_fsmount
-        SCMP_SYS(fsmount),
-#endif
-#ifdef __NR_open_tree
+#ifdef __SNR_open_tree
         SCMP_SYS(open_tree),
-#endif
-#ifdef __NR_move_mount
-        SCMP_SYS(move_mount),
 #endif
         SCMP_SYS(swapon),
         SCMP_SYS(swapoff),
@@ -137,7 +131,7 @@ int create_seccomp_profile(bool cusetpm, unsigned int action)
         SCMP_SYS(delete_module), 
         SCMP_SYS(seccomp),
         SCMP_SYS(kexec_file_load),
-#ifdef __NR_sysctl
+#ifdef __SNR_sysctl
         SCMP_SYS(sysctl),
 #endif
         /* semaphores and messages queues */
@@ -174,7 +168,7 @@ int create_seccomp_profile(bool cusetpm, unsigned int action)
         SCMP_SYS(sethostname),
         SCMP_SYS(setdomainname),
         SCMP_SYS(quotactl),
-#ifdef __NR_quotactl_fd
+#if defined(__SNR_quotactl_fd) && defined(__NR_quotactl_fd)
         SCMP_SYS(quotactl_fd),
 #endif
         SCMP_SYS(readahead),
@@ -192,10 +186,10 @@ int create_seccomp_profile(bool cusetpm, unsigned int action)
         SCMP_SYS(signalfd),
         SCMP_SYS(eventfd),
         SCMP_SYS(timerfd_settime),
-#ifdef __NR_timer_settime64
+#ifdef __SNR_timer_settime64
         SCMP_SYS(timer_settime64),
 #endif
-#ifdef __NR_timerfd_settime64
+#ifdef __SNR_timerfd_settime64
         SCMP_SYS(timerfd_settime64),
 #endif
         SCMP_SYS(timerfd_gettime),
@@ -208,10 +202,10 @@ int create_seccomp_profile(bool cusetpm, unsigned int action)
         SCMP_SYS(acct),
         SCMP_SYS(prlimit64),
         SCMP_SYS(setrlimit),
-#ifdef __NR_bpf
+#ifdef __SNR_bpf
         SCMP_SYS(bpf),
 #endif
-#ifdef __NR_copy_filerange
+#ifdef __SNR_copy_filerange
         SCMP_SYS(copy_filerange),
 #endif
         /* xattrs */
@@ -274,7 +268,7 @@ int create_seccomp_profile(bool cusetpm, unsigned int action)
         SCMP_SYS(fork),
         SCMP_SYS(vfork),
         SCMP_SYS(prctl),
-#ifdef __NR_clone3
+#ifdef __SNR_clone3
         SCMP_SYS(clone3),
 #endif
         /* misc */