From bf747eb21e428c2b3ead6ebcca27951b681963a0 Mon Sep 17 00:00:00 2001 From: Paul Moore Date: Sun, 29 Sep 2019 22:02:42 -0400 Subject: arch: update the internal syscall tables to Linux v5.4-rc4 This is long overdue so quite a few changes, including tweaks to support some newly direct wired syscalls which were previously multiplexed. We really need to make sure we update the syscall table more often. Acked-by: Tom Hromatka Signed-off-by: Paul Moore --- include/seccomp-syscalls.h | 208 +++++++++++++++++++++++++++++++++++++++++- src/arch-aarch64-syscalls.c | 35 ++++++- src/arch-arm-syscalls.c | 35 ++++++- src/arch-mips-syscalls.c | 51 ++++++++--- src/arch-mips64-syscalls.c | 31 ++++++- src/arch-mips64n32-syscalls.c | 31 ++++++- src/arch-parisc-syscalls.c | 33 ++++++- src/arch-ppc-syscalls.c | 51 ++++++++--- src/arch-ppc64-syscalls.c | 53 ++++++++--- src/arch-s390-syscalls.c | 57 +++++++++--- src/arch-s390.c | 160 ++++++++++++++++++++++++++++---- src/arch-s390x-syscalls.c | 59 +++++++++--- src/arch-s390x.c | 160 ++++++++++++++++++++++++++++---- src/arch-x32-syscalls.c | 31 ++++++- src/arch-x86-syscalls.c | 105 ++++++++++++++++++--- src/arch-x86.c | 161 ++++++++++++++++++++++++++++---- src/arch-x86_64-syscalls.c | 31 ++++++- 17 files changed, 1150 insertions(+), 142 deletions(-) diff --git a/include/seccomp-syscalls.h b/include/seccomp-syscalls.h index 1a4b8db..6457592 100644 --- a/include/seccomp-syscalls.h +++ b/include/seccomp-syscalls.h @@ -242,6 +242,36 @@ #define __PNR_statx -10208 #define __PNR_io_pgetevents -10209 #define __PNR_rseq -10210 +#define __PNR_setrlimit -10211 +#define __PNR_clock_adjtime64 -10212 +#define __PNR_clock_getres_time64 -10213 +#define __PNR_clock_gettime64 -10214 +#define __PNR_clock_nanosleep_time64 -10215 +#define __PNR_clock_settime64 -10216 +#define __PNR_clone3 -10217 +#define __PNR_fsconfig -10218 +#define __PNR_fsmount -10219 +#define __PNR_fsopen -10220 +#define __PNR_fspick -10221 +#define __PNR_futex_time64 -10222 +#define __PNR_io_pgetevents_time64 -10223 +#define __PNR_move_mount -10224 +#define __PNR_mq_timedreceive_time64 -10225 +#define __PNR_mq_timedsend_time64 -10226 +#define __PNR_open_tree -10227 +#define __PNR_pidfd_open -10228 +#define __PNR_pidfd_send_signal -10229 +#define __PNR_ppoll_time64 -10230 +#define __PNR_pselect6_time64 -10231 +#define __PNR_recvmmsg_time64 -10232 +#define __PNR_rt_sigtimedwait_time64 -10233 +#define __PNR_sched_rr_get_interval_time64 -10234 +#define __PNR_semtimedop_time64 -10235 +#define __PNR_timer_gettime64 -10236 +#define __PNR_timer_settime64 -10237 +#define __PNR_timerfd_gettime64 -10238 +#define __PNR_timerfd_settime64 -10239 +#define __PNR_utimensat_time64 -10240 /* * libseccomp syscall definitions @@ -395,16 +425,52 @@ #define __SNR_clock_adjtime __NR_clock_adjtime +#ifdef __NR_clock_adjtime64 +#define __SNR_clock_adjtime64 __NR_clock_adjtime64 +#else +#define __SNR_clock_adjtime64 __PNR_clock_adjtime64 +#endif + #define __SNR_clock_getres __NR_clock_getres +#ifdef __NR_clock_getres_time64 +#define __SNR_clock_getres_time64 __NR_clock_getres_time64 +#else +#define __SNR_clock_getres_time64 __PNR_clock_getres_time64 +#endif + #define __SNR_clock_gettime __NR_clock_gettime +#ifdef __NR_clock_gettime64 +#define __SNR_clock_gettime64 __NR_clock_gettime64 +#else +#define __SNR_clock_gettime64 __PNR_clock_gettime64 +#endif + #define __SNR_clock_nanosleep __NR_clock_nanosleep +#ifdef __NR_clock_nanosleep_time64 +#define __SNR_clock_nanosleep_time64 __NR_clock_nanosleep_time64 +#else +#define __SNR_clock_nanosleep_time64 __PNR_clock_nanosleep_time64 +#endif + #define __SNR_clock_settime __NR_clock_settime +#ifdef __NR_clock_settime64 +#define __SNR_clock_settime64 __NR_clock_settime64 +#else +#define __SNR_clock_settime64 __PNR_clock_settime64 +#endif + #define __SNR_clone __NR_clone +#ifdef __NR_clone3 +#define __SNR_clone3 __NR_clone3 +#else +#define __SNR_clone3 __PNR_clone3 +#endif + #define __SNR_close __NR_close #ifdef __NR_connect @@ -563,8 +629,32 @@ #define __SNR_fremovexattr __NR_fremovexattr +#ifdef __NR_fsconfig +#define __SNR_fsconfig __NR_fsconfig +#else +#define __SNR_fsconfig __PNR_fsconfig +#endif + #define __SNR_fsetxattr __NR_fsetxattr +#ifdef __NR_fsmount +#define __SNR_fsmount __NR_fsmount +#else +#define __SNR_fsmount __PNR_fsmount +#endif + +#ifdef __NR_fsopen +#define __SNR_fsopen __NR_fsopen +#else +#define __SNR_fsopen __PNR_fsopen +#endif + +#ifdef __NR_fspick +#define __SNR_fspick __NR_fspick +#else +#define __SNR_fspick __PNR_fspick +#endif + #ifdef __NR_fstat #define __SNR_fstat __NR_fstat #else @@ -617,6 +707,12 @@ #define __SNR_futex __NR_futex +#ifdef __NR_futex_time64 +#define __SNR_futex_time64 __NR_futex_time64 +#else +#define __SNR_futex_time64 __PNR_futex_time64 +#endif + #ifdef __NR_futimesat #define __SNR_futimesat __NR_futimesat #else @@ -849,6 +945,12 @@ #define __SNR_io_pgetevents __PNR_io_pgetevents #endif +#ifdef __NR_io_pgetevents_time64 +#define __SNR_io_pgetevents_time64 __NR_io_pgetevents_time64 +#else +#define __SNR_io_pgetevents_time64 __PNR_io_pgetevents_time64 +#endif + #define __SNR_io_setup __NR_io_setup #define __SNR_io_submit __NR_io_submit @@ -1025,6 +1127,12 @@ #define __SNR_mount __NR_mount +#ifdef __NR_move_mount +#define __SNR_move_mount __NR_move_mount +#else +#define __SNR_move_mount __PNR_move_mount +#endif + #ifdef __NR_move_pages #define __SNR_move_pages __NR_move_pages #else @@ -1047,8 +1155,20 @@ #define __SNR_mq_timedreceive __NR_mq_timedreceive +#ifdef __NR_mq_timedreceive_time64 +#define __SNR_mq_timedreceive_time64 __NR_mq_timedreceive_time64 +#else +#define __SNR_mq_timedreceive_time64 __PNR_mq_timedreceive_time64 +#endif + #define __SNR_mq_timedsend __NR_mq_timedsend +#ifdef __NR_mq_timedsend_time64 +#define __SNR_mq_timedsend_time64 __NR_mq_timedsend_time64 +#else +#define __SNR_mq_timedsend_time64 __PNR_mq_timedsend_time64 +#endif + #define __SNR_mq_unlink __NR_mq_unlink #define __SNR_mremap __NR_mremap @@ -1157,6 +1277,12 @@ #define __SNR_open_by_handle_at __NR_open_by_handle_at +#ifdef __NR_open_tree +#define __SNR_open_tree __NR_open_tree +#else +#define __SNR_open_tree __PNR_open_tree +#endif + #define __SNR_openat __NR_openat #ifdef __NR_pause @@ -1187,6 +1313,18 @@ #define __SNR_personality __NR_personality +#ifdef __NR_pidfd_open +#define __SNR_pidfd_open __NR_pidfd_open +#else +#define __SNR_pidfd_open __PNR_pidfd_open +#endif + +#ifdef __NR_pidfd_send_signal +#define __SNR_pidfd_send_signal __NR_pidfd_send_signal +#else +#define __SNR_pidfd_send_signal __PNR_pidfd_send_signal +#endif + #ifdef __NR_pipe #define __SNR_pipe __NR_pipe #else @@ -1221,7 +1359,11 @@ #define __SNR_poll __PNR_poll #endif -#define __SNR_ppoll __NR_ppoll +#ifdef __NR_ppoll_time64 +#define __SNR_ppoll_time64 __NR_ppoll_time64 +#else +#define __SNR_ppoll_time64 __PNR_ppoll_time64 +#endif #define __SNR_prctl __NR_prctl @@ -1251,6 +1393,12 @@ #define __SNR_pselect6 __NR_pselect6 +#ifdef __NR_pselect6_time64 +#define __SNR_pselect6_time64 __NR_pselect6_time64 +#else +#define __SNR_pselect6_time64 __PNR_pselect6_time64 +#endif + #define __SNR_ptrace __NR_ptrace #ifdef __NR_putpmsg @@ -1317,6 +1465,12 @@ #define __SNR_recvmmsg __PNR_recvmmsg #endif +#ifdef __NR_recvmmsg_time64 +#define __SNR_recvmmsg_time64 __NR_recvmmsg_time64 +#else +#define __SNR_recvmmsg_time64 __PNR_recvmmsg_time64 +#endif + #ifdef __NR_recvmsg #define __SNR_recvmsg __NR_recvmsg #else @@ -1367,6 +1521,12 @@ #define __SNR_rt_sigtimedwait __NR_rt_sigtimedwait +#ifdef __NR_rt_sigtimedwait_time64 +#define __SNR_rt_sigtimedwait_time64 __NR_rt_sigtimedwait_time64 +#else +#define __SNR_rt_sigtimedwait_time64 __PNR_rt_sigtimedwait_time64 +#endif + #define __SNR_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo #ifdef __NR_rtas @@ -1419,6 +1579,12 @@ #define __SNR_sched_rr_get_interval __NR_sched_rr_get_interval +#ifdef __NR_sched_rr_get_interval_time64 +#define __SNR_sched_rr_get_interval_time64 __NR_sched_rr_get_interval_time64 +#else +#define __SNR_sched_rr_get_interval_time64 __PNR_sched_rr_get_interval_time64 +#endif + #define __SNR_sched_setaffinity __NR_sched_setaffinity #define __SNR_sched_setattr __NR_sched_setattr @@ -1467,6 +1633,12 @@ #define __SNR_semtimedop __PNR_semtimedop #endif +#ifdef __NR_semtimedop_time64 +#define __SNR_semtimedop_time64 __NR_semtimedop_time64 +#else +#define __SNR_semtimedop_time64 __PNR_semtimedop_time64 +#endif + #ifdef __NR_send #define __SNR_send __NR_send #else @@ -1637,7 +1809,11 @@ #define __SNR_setreuid32 __PNR_setreuid32 #endif +#ifdef __NR_setrlimit #define __SNR_setrlimit __NR_setrlimit +#else +#define __SNR_setrlimit __PNR_setrlimit +#endif #define __SNR_setsid __NR_setsid @@ -1921,8 +2097,20 @@ #define __SNR_timer_gettime __NR_timer_gettime +#ifdef __NR_timer_gettime64 +#define __SNR_timer_gettime64 __NR_timer_gettime64 +#else +#define __SNR_timer_gettime64 __PNR_timer_gettime64 +#endif + #define __SNR_timer_settime __NR_timer_settime +#ifdef __NR_timer_settime64 +#define __SNR_timer_settime64 __NR_timer_settime64 +#else +#define __SNR_timer_settime64 __PNR_timer_settime64 +#endif + #ifdef __NR_timerfd #define __SNR_timerfd __NR_timerfd #else @@ -1933,8 +2121,20 @@ #define __SNR_timerfd_gettime __NR_timerfd_gettime +#ifdef __NR_timerfd_gettime64 +#define __SNR_timerfd_gettime64 __NR_timerfd_gettime64 +#else +#define __SNR_timerfd_gettime64 __PNR_timerfd_gettime64 +#endif + #define __SNR_timerfd_settime __NR_timerfd_settime +#ifdef __NR_timerfd_settime64 +#define __SNR_timerfd_settime64 __NR_timerfd_settime64 +#else +#define __SNR_timerfd_settime64 __PNR_timerfd_settime64 +#endif + #define __SNR_times __NR_times #define __SNR_tkill __NR_tkill @@ -2037,6 +2237,12 @@ #define __SNR_utimensat __NR_utimensat +#ifdef __NR_utimensat_time64 +#define __SNR_utimensat_time64 __NR_utimensat_time64 +#else +#define __SNR_utimensat_time64 __PNR_utimensat_time64 +#endif + #ifdef __NR_utimes #define __SNR_utimes __NR_utimes #else diff --git a/src/arch-aarch64-syscalls.c b/src/arch-aarch64-syscalls.c index 90de283..02f25eb 100644 --- a/src/arch-aarch64-syscalls.c +++ b/src/arch-aarch64-syscalls.c @@ -26,7 +26,7 @@ #include "arch.h" #include "arch-aarch64.h" -/* NOTE: based on Linux 4.15-rc7 */ +/* NOTE: based on Linux v5.4-rc4 */ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "_llseek", __PNR__llseek }, { "_newselect", __PNR__newselect }, @@ -58,11 +58,17 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "chown32", __PNR_chown32 }, { "chroot", 51 }, { "clock_adjtime", 266 }, + { "clock_adjtime64", __PNR_clock_adjtime64 }, { "clock_getres", 114 }, + { "clock_getres_time64", __PNR_clock_getres_time64 }, { "clock_gettime", 113 }, + { "clock_gettime64", __PNR_clock_gettime64 }, { "clock_nanosleep", 115 }, + { "clock_nanosleep_time64", __PNR_clock_nanosleep_time64 }, { "clock_settime", 112 }, + { "clock_settime64", __PNR_clock_settime64 }, { "clone", 220 }, + { "clone3", __PNR_clone3 }, { "close", 57 }, { "connect", 203 }, { "copy_file_range", 285 }, @@ -106,7 +112,11 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "flock", 32 }, { "fork", __PNR_fork }, { "fremovexattr", 16 }, + { "fsconfig", 431 }, { "fsetxattr", 7 }, + { "fsmount", 432 }, + { "fsopen", 430 }, + { "fspick", 433 }, { "fstat", 80 }, { "fstat64", __PNR_fstat64 }, { "fstatat64", __PNR_fstatat64 }, @@ -117,6 +127,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "ftruncate", 46 }, { "ftruncate64", __PNR_ftruncate64 }, { "futex", 98 }, + { "futex_time64", __PNR_futex_time64 }, { "futimesat", __PNR_futimesat }, { "get_kernel_syms", __PNR_get_kernel_syms }, { "get_mempolicy", 236 }, @@ -148,7 +159,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "getresgid32", __PNR_getresgid32 }, { "getresuid", 148 }, { "getresuid32", __PNR_getresuid32 }, - { "getrlimit", 163 }, + { "getrlimit", __PNR_getrlimit }, { "getrusage", 165 }, { "getsid", 156 }, { "getsockname", 204 }, @@ -169,6 +180,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "io_destroy", 1 }, { "io_getevents", 4 }, { "io_pgetevents", 292 }, + { "io_pgetevents_time64", __PNR_io_pgetevents_time64 }, { "io_setup", 0 }, { "io_submit", 2 }, { "io_uring_setup", 425 }, @@ -217,6 +229,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "mmap2", __PNR_mmap2 }, { "modify_ldt", __PNR_modify_ldt }, { "mount", 40 }, + { "move_mount", 429 }, { "move_pages", 239 }, { "mprotect", 226 }, { "mpx", __PNR_mpx }, @@ -224,7 +237,9 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "mq_notify", 184 }, { "mq_open", 180 }, { "mq_timedreceive", 183 }, + { "mq_timedreceive_time64", __PNR_mq_timedreceive_time64 }, { "mq_timedsend", 182 }, + { "mq_timedsend_time64", __PNR_mq_timedsend_time64 }, { "mq_unlink", 181 }, { "mremap", 216 }, { "msgctl", 187 }, @@ -249,6 +264,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "oldwait4", __PNR_oldwait4 }, { "open", __PNR_open }, { "open_by_handle_at", 265 }, + { "open_tree", 428 }, { "openat", 56 }, { "pause", __PNR_pause }, { "pciconfig_iobase", __PNR_pciconfig_iobase }, @@ -256,6 +272,8 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "pciconfig_write", __PNR_pciconfig_write }, { "perf_event_open", 241 }, { "personality", 92 }, + { "pidfd_open", 434 }, + { "pidfd_send_signal", 424 }, { "pipe", __PNR_pipe }, { "pipe2", 59 }, { "pivot_root", 41 }, @@ -264,6 +282,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "pkey_mprotect", 288 }, { "poll", __PNR_poll }, { "ppoll", 73 }, + { "ppoll_time64", __PNR_ppoll_time64 }, { "prctl", 167 }, { "pread64", 67 }, { "preadv", 69 }, @@ -274,6 +293,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "prof", __PNR_prof }, { "profil", __PNR_profil }, { "pselect6", 72 }, + { "pselect6_time64", __PNR_pselect6_time64 }, { "ptrace", 117 }, { "putpmsg", __PNR_putpmsg }, { "pwrite64", 68 }, @@ -291,6 +311,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "recv", __PNR_recv }, { "recvfrom", 207 }, { "recvmmsg", 243 }, + { "recvmmsg_time64", __PNR_recvmmsg_time64 }, { "recvmsg", 212 }, { "remap_file_pages", 234 }, { "removexattr", 14 }, @@ -308,6 +329,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "rt_sigreturn", 139 }, { "rt_sigsuspend", 133 }, { "rt_sigtimedwait", 137 }, + { "rt_sigtimedwait_time64", __PNR_rt_sigtimedwait_time64 }, { "rt_tgsigqueueinfo", 240 }, { "rtas", __PNR_rtas }, { "s390_guarded_storage", __PNR_s390_guarded_storage }, @@ -322,6 +344,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "sched_getparam", 121 }, { "sched_getscheduler", 120 }, { "sched_rr_get_interval", 127 }, + { "sched_rr_get_interval_time64", __PNR_sched_rr_get_interval_time64 }, { "sched_setaffinity", 122 }, { "sched_setattr", 274 }, { "sched_setparam", 118 }, @@ -334,6 +357,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "semget", 190 }, { "semop", 193 }, { "semtimedop", 192 }, + { "semtimedop_time64", __PNR_semtimedop_time64 }, { "send", __PNR_send }, { "sendfile", 71 }, { "sendfile64", __PNR_sendfile64 }, @@ -367,7 +391,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "setresuid32", __PNR_setresuid32 }, { "setreuid", 145 }, { "setreuid32", __PNR_setreuid32 }, - { "setrlimit", 164 }, + { "setrlimit", __PNR_setrlimit }, { "setsid", 157 }, { "setsockopt", 208 }, { "settimeofday", 170 }, @@ -427,11 +451,15 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "timer_delete", 111 }, { "timer_getoverrun", 109 }, { "timer_gettime", 108 }, + { "timer_gettime64", __PNR_timer_gettime64 }, { "timer_settime", 110 }, + { "timer_settime64", __PNR_timer_settime64 }, { "timerfd", __PNR_timerfd }, { "timerfd_create", 85 }, { "timerfd_gettime", 87 }, + { "timerfd_gettime64", __PNR_timerfd_gettime64 }, { "timerfd_settime", 86 }, + { "timerfd_settime64", __PNR_timerfd_settime64 }, { "times", 153 }, { "tkill", 130 }, { "truncate", 45 }, @@ -453,6 +481,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \ { "ustat", __PNR_ustat }, { "utime", __PNR_utime }, { "utimensat", 88 }, + { "utimensat_time64", __PNR_utimensat_time64 }, { "utimes", __PNR_utimes }, { "vfork", __PNR_vfork }, { "vhangup", 58 }, diff --git a/src/arch-arm-syscalls.c b/src/arch-arm-syscalls.c index a0dbd60..923aae9 100644 --- a/src/arch-arm-syscalls.c +++ b/src/arch-arm-syscalls.c @@ -37,7 +37,7 @@ #define __SCMP_NR_BASE __SCMP_NR_OABI_SYSCALL_BASE #endif -/* NOTE: based on Linux 4.15-rc7 */ +/* NOTE: based on Linux v5.4-rc4 */ const struct arch_syscall_def arm_syscall_table[] = { \ /* NOTE: arm_sync_file_range() and sync_file_range2() share values */ { "_llseek", (__SCMP_NR_BASE + 140) }, @@ -70,11 +70,17 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "chown32", (__SCMP_NR_BASE + 212) }, { "chroot", (__SCMP_NR_BASE + 61) }, { "clock_adjtime", (__SCMP_NR_BASE + 372) }, + { "clock_adjtime64", (__SCMP_NR_BASE + 405) }, { "clock_getres", (__SCMP_NR_BASE + 264) }, + { "clock_getres_time64", (__SCMP_NR_BASE + 406) }, { "clock_gettime", (__SCMP_NR_BASE + 263) }, + { "clock_gettime64", (__SCMP_NR_BASE + 403) }, { "clock_nanosleep", (__SCMP_NR_BASE + 265) }, + { "clock_nanosleep_time64", (__SCMP_NR_BASE + 407) }, { "clock_settime", (__SCMP_NR_BASE + 262) }, + { "clock_settime64", (__SCMP_NR_BASE + 404) }, { "clone", (__SCMP_NR_BASE + 120) }, + { "clone3", (__SCMP_NR_BASE + 435) }, { "close", (__SCMP_NR_BASE + 6) }, { "connect", (__SCMP_NR_BASE + 283) }, { "copy_file_range", (__SCMP_NR_BASE + 391) }, @@ -118,7 +124,11 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "flock", (__SCMP_NR_BASE + 143) }, { "fork", (__SCMP_NR_BASE + 2) }, { "fremovexattr", (__SCMP_NR_BASE + 237) }, + { "fsconfig", (__SCMP_NR_BASE + 431) }, { "fsetxattr", (__SCMP_NR_BASE + 228) }, + { "fsmount", (__SCMP_NR_BASE + 432) }, + { "fsopen", (__SCMP_NR_BASE + 430) }, + { "fspick", (__SCMP_NR_BASE + 433) }, { "fstat", (__SCMP_NR_BASE + 108) }, { "fstat64", (__SCMP_NR_BASE + 197) }, { "fstatat64", (__SCMP_NR_BASE + 327) }, @@ -129,6 +139,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "ftruncate", (__SCMP_NR_BASE + 93) }, { "ftruncate64", (__SCMP_NR_BASE + 194) }, { "futex", (__SCMP_NR_BASE + 240) }, + { "futex_time64", (__SCMP_NR_BASE + 422) }, { "futimesat", (__SCMP_NR_BASE + 326) }, { "get_kernel_syms", __PNR_get_kernel_syms }, { "get_mempolicy", (__SCMP_NR_BASE + 320) }, @@ -181,6 +192,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "io_destroy", (__SCMP_NR_BASE + 244) }, { "io_getevents", (__SCMP_NR_BASE + 245) }, { "io_pgetevents", (__SCMP_NR_BASE + 399) }, + { "io_pgetevents_time64", (__SCMP_NR_BASE + 416) }, { "io_setup", (__SCMP_NR_BASE + 243) }, { "io_submit", (__SCMP_NR_BASE + 246) }, { "io_uring_setup", (__SCMP_NR_BASE + 425) }, @@ -193,7 +205,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "ioprio_set", (__SCMP_NR_BASE + 314) }, { "ipc", __PNR_ipc }, { "kcmp", (__SCMP_NR_BASE + 378) }, - { "kexec_file_load", __PNR_kexec_file_load }, + { "kexec_file_load", (__SCMP_NR_BASE + 401) }, { "kexec_load", (__SCMP_NR_BASE + 347) }, { "keyctl", (__SCMP_NR_BASE + 311) }, { "kill", (__SCMP_NR_BASE + 37) }, @@ -216,7 +228,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "mbind", (__SCMP_NR_BASE + 319) }, { "membarrier", (__SCMP_NR_BASE + 389) }, { "memfd_create", (__SCMP_NR_BASE + 385) }, - { "migrate_pages", __PNR_migrate_pages }, + { "migrate_pages", (__SCMP_NR_BASE + 400) }, { "mincore", (__SCMP_NR_BASE + 219) }, { "mkdir", (__SCMP_NR_BASE + 39) }, { "mkdirat", (__SCMP_NR_BASE + 323) }, @@ -229,6 +241,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "mmap2", (__SCMP_NR_BASE + 192) }, { "modify_ldt", __PNR_modify_ldt }, { "mount", (__SCMP_NR_BASE + 21) }, + { "move_mount", (__SCMP_NR_BASE + 429) }, { "move_pages", (__SCMP_NR_BASE + 344) }, { "mprotect", (__SCMP_NR_BASE + 125) }, { "mpx", __PNR_mpx }, @@ -236,7 +249,9 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "mq_notify", (__SCMP_NR_BASE + 278) }, { "mq_open", (__SCMP_NR_BASE + 274) }, { "mq_timedreceive", (__SCMP_NR_BASE + 277) }, + { "mq_timedreceive_time64", (__SCMP_NR_BASE + 419) }, { "mq_timedsend", (__SCMP_NR_BASE + 276) }, + { "mq_timedsend_time64", (__SCMP_NR_BASE + 418) }, { "mq_unlink", (__SCMP_NR_BASE + 275) }, { "mremap", (__SCMP_NR_BASE + 163) }, { "msgctl", (__SCMP_NR_BASE + 304) }, @@ -261,6 +276,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "oldwait4", __PNR_oldwait4 }, { "open", (__SCMP_NR_BASE + 5) }, { "open_by_handle_at", (__SCMP_NR_BASE + 371) }, + { "open_tree", (__SCMP_NR_BASE + 428) }, { "openat", (__SCMP_NR_BASE + 322) }, { "pause", (__SCMP_NR_BASE + 29) }, { "pciconfig_iobase", (__SCMP_NR_BASE + 271) }, @@ -268,6 +284,8 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "pciconfig_write", (__SCMP_NR_BASE + 273) }, { "perf_event_open", (__SCMP_NR_BASE + 364) }, { "personality", (__SCMP_NR_BASE + 136) }, + { "pidfd_open", (__SCMP_NR_BASE + 434) }, + { "pidfd_send_signal", (__SCMP_NR_BASE + 424) }, { "pipe", (__SCMP_NR_BASE + 42) }, { "pipe2", (__SCMP_NR_BASE + 359) }, { "pivot_root", (__SCMP_NR_BASE + 218) }, @@ -276,6 +294,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "pkey_mprotect", (__SCMP_NR_BASE + 394) }, { "poll", (__SCMP_NR_BASE + 168) }, { "ppoll", (__SCMP_NR_BASE + 336) }, + { "ppoll_time64", (__SCMP_NR_BASE + 414) }, { "prctl", (__SCMP_NR_BASE + 172) }, { "pread64", (__SCMP_NR_BASE + 180) }, { "preadv", (__SCMP_NR_BASE + 361) }, @@ -286,6 +305,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "prof", __PNR_prof }, { "profil", __PNR_profil }, { "pselect6", (__SCMP_NR_BASE + 335) }, + { "pselect6_time64", (__SCMP_NR_BASE + 413) }, { "ptrace", (__SCMP_NR_BASE + 26) }, { "putpmsg", __PNR_putpmsg }, { "pwrite64", (__SCMP_NR_BASE + 181) }, @@ -303,6 +323,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "recv", (__SCMP_NR_BASE + 291) }, { "recvfrom", (__SCMP_NR_BASE + 292) }, { "recvmmsg", (__SCMP_NR_BASE + 365) }, + { "recvmmsg_time64", (__SCMP_NR_BASE + 417) }, { "recvmsg", (__SCMP_NR_BASE + 297) }, { "remap_file_pages", (__SCMP_NR_BASE + 253) }, { "removexattr", (__SCMP_NR_BASE + 235) }, @@ -320,6 +341,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "rt_sigreturn", (__SCMP_NR_BASE + 173) }, { "rt_sigsuspend", (__SCMP_NR_BASE + 179) }, { "rt_sigtimedwait", (__SCMP_NR_BASE + 177) }, + { "rt_sigtimedwait_time64", (__SCMP_NR_BASE + 421) }, { "rt_tgsigqueueinfo", (__SCMP_NR_BASE + 363) }, { "rtas", __PNR_rtas }, { "s390_guarded_storage", __PNR_s390_guarded_storage }, @@ -334,6 +356,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "sched_getparam", (__SCMP_NR_BASE + 155) }, { "sched_getscheduler", (__SCMP_NR_BASE + 157) }, { "sched_rr_get_interval", (__SCMP_NR_BASE + 161) }, + { "sched_rr_get_interval_time64", (__SCMP_NR_BASE + 423) }, { "sched_setaffinity", (__SCMP_NR_BASE + 241) }, { "sched_setattr", (__SCMP_NR_BASE + 380) }, { "sched_setparam", (__SCMP_NR_BASE + 154) }, @@ -346,6 +369,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "semget", (__SCMP_NR_BASE + 299) }, { "semop", (__SCMP_NR_BASE + 298) }, { "semtimedop", (__SCMP_NR_BASE + 312) }, + { "semtimedop_time64", (__SCMP_NR_BASE + 420) }, { "send", (__SCMP_NR_BASE + 289) }, { "sendfile", (__SCMP_NR_BASE + 187) }, { "sendfile64", (__SCMP_NR_BASE + 239) }, @@ -439,11 +463,15 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "timer_delete", (__SCMP_NR_BASE + 261) }, { "timer_getoverrun", (__SCMP_NR_BASE + 260) }, { "timer_gettime", (__SCMP_NR_BASE + 259) }, + { "timer_gettime64", (__SCMP_NR_BASE + 408) }, { "timer_settime", (__SCMP_NR_BASE + 258) }, + { "timer_settime64", (__SCMP_NR_BASE + 409) }, { "timerfd", __PNR_timerfd }, { "timerfd_create", (__SCMP_NR_BASE + 350) }, { "timerfd_gettime", (__SCMP_NR_BASE + 354) }, + { "timerfd_gettime64", (__SCMP_NR_BASE + 410) }, { "timerfd_settime", (__SCMP_NR_BASE + 353) }, + { "timerfd_settime64", (__SCMP_NR_BASE + 411) }, { "times", (__SCMP_NR_BASE + 43) }, { "tkill", (__SCMP_NR_BASE + 238) }, { "truncate", (__SCMP_NR_BASE + 92) }, @@ -465,6 +493,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \ { "ustat", (__SCMP_NR_BASE + 62) }, { "utime", __PNR_utime }, { "utimensat", (__SCMP_NR_BASE + 348) }, + { "utimensat_time64", (__SCMP_NR_BASE + 412) }, { "utimes", (__SCMP_NR_BASE + 269) }, { "vfork", (__SCMP_NR_BASE + 190) }, { "vhangup", (__SCMP_NR_BASE + 111) }, diff --git a/src/arch-mips-syscalls.c b/src/arch-mips-syscalls.c index 8706ae5..c0c5d40 100644 --- a/src/arch-mips-syscalls.c +++ b/src/arch-mips-syscalls.c @@ -30,7 +30,7 @@ /* O32 ABI */ #define __SCMP_NR_BASE 4000 -/* NOTE: based on Linux 4.15-rc7 */ +/* NOTE: based on Linux v5.4-rc4 */ const struct arch_syscall_def mips_syscall_table[] = { \ { "_llseek", (__SCMP_NR_BASE + 140) }, { "_newselect", (__SCMP_NR_BASE + 142) }, @@ -62,11 +62,17 @@ const struct arch_syscall_def mips_syscall_table[] = { \ { "chown32", (__PNR_chown32) }, { "chroot", (__SCMP_NR_BASE + 61) }, { "clock_adjtime", (__SCMP_NR_BASE + 341) }, + { "clock_adjtime64", (__SCMP_NR_BASE + 405) }, { "clock_getres", (__SCMP_NR_BASE + 264) }, + { "clock_getres_time64", (__SCMP_NR_BASE + 406) }, { "clock_gettime", (__SCMP_NR_BASE + 263) }, + { "clock_gettime64", (__SCMP_NR_BASE + 403) }, { "clock_nanosleep", (__SCMP_NR_BASE + 265) }, + { "clock_nanosleep_time64", (__SCMP_NR_BASE + 407) }, { "clock_settime", (__SCMP_NR_BASE + 262) }, + { "clock_settime64", (__SCMP_NR_BASE + 404) }, { "clone", (__SCMP_NR_BASE + 120) }, + { "clone3", (__SCMP_NR_BASE + 435) }, { "close", (__SCMP_NR_BASE + 6) }, { "connect", (__SCMP_NR_BASE + 170) }, { "copy_file_range", (__SCMP_NR_BASE + 360) }, @@ -110,7 +116,11 @@ const struct arch_syscall_def mips_syscall_table[] = { \ { "flock", (__SCMP_NR_BASE + 143) }, { "fork", (__SCMP_NR_BASE + 2) }, { "fremovexattr", (__SCMP_NR_BASE + 235) }, + { "fsconfig", (__SCMP_NR_BASE + 431) }, { "fsetxattr", (__SCMP_NR_BASE + 226) }, + { "fsmount", (__SCMP_NR_BASE + 432) }, + { "fsopen", (__SCMP_NR_BASE + 430) }, + { "fspick", (__SCMP_NR_BASE + 433) }, { "fstat", (__SCMP_NR_BASE + 108) }, { "fstat64", (__SCMP_NR_BASE + 215) }, { "fstatat64", (__SCMP_NR_BASE + 293) }, @@ -121,6 +131,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \ { "ftruncate", (__SCMP_NR_BASE + 93) }, { "ftruncate64", (__SCMP_NR_BASE + 212) }, { "futex", (__SCMP_NR_BASE + 238) }, + { "futex_time64", (__SCMP_NR_BASE + 422) }, { "futimesat", (__SCMP_NR_BASE + 292) }, { "get_kernel_syms", (__SCMP_NR_BASE + 130) }, { "get_mempolicy", (__SCMP_NR_BASE + 269) }, @@ -173,6 +184,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \ { "io_destroy", (__SCMP_NR_BASE + 242) }, { "io_getevents", (__SCMP_NR_BASE + 243) }, { "io_pgetevents", (__SCMP_NR_BASE + 368) }, + { "io_pgetevents_time64", (__SCMP_NR_BASE + 416) }, { "io_setup", (__SCMP_NR_BASE + 241) }, { "io_submit", (__SCMP_NR_BASE + 244) }, { "io_uring_setup", (__SCMP_NR_BASE + 425) }, @@ -221,6 +233,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \ { "mmap2", (__SCMP_NR_BASE + 210) }, { "modify_ldt", (__SCMP_NR_BASE + 123) }, { "mount", (__SCMP_NR_BASE + 21) }, + { "move_mount", (__SCMP_NR_BASE + 429) }, { "move_pages", (__SCMP_NR_BASE + 308) }, { "mprotect", (__SCMP_NR_BASE + 125) }, { "mpx", (__SCMP_NR_BASE + 56) }, @@ -228,13 +241,15 @@ const struct arch_syscall_def mips_syscall_table[] = { \ { "mq_notify", (__SCMP_NR_BASE + 275) }, { "mq_open", (__SCMP_NR_BASE + 271) }, { "mq_timedreceive", (__SCMP_NR_BASE + 274) }, + { "mq_timedreceive_time64", (__SCMP_NR_BASE + 419) }, { "mq_timedsend", (__SCMP_NR_BASE + 273) }, + { "mq_timedsend_time64", (__SCMP_NR_BASE + 418) }, { "mq_unlink", (__SCMP_NR_BASE + 272) }, { "mremap", (__SCMP_NR_BASE + 167) }, - { "msgctl", __PNR_msgctl }, - { "msgget", __PNR_msgget }, - { "msgrcv", __PNR_msgrcv }, - { "msgsnd", __PNR_msgsnd }, + { "msgctl", (__SCMP_NR_BASE + 402) }, + { "msgget", (__SCMP_NR_BASE + 399) }, + { "msgrcv", (__SCMP_NR_BASE + 401) }, + { "msgsnd", (__SCMP_NR_BASE + 400) }, { "msync", (__SCMP_NR_BASE + 144) }, { "multiplexer", __PNR_multiplexer }, { "munlock", (__SCMP_NR_BASE + 155) }, @@ -253,6 +268,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \ { "oldwait4", __PNR_oldwait4 }, { "open", (__SCMP_NR_BASE + 5) }, { "open_by_handle_at", (__SCMP_NR_BASE + 340) }, + { "open_tree", (__SCMP_NR_BASE + 428) }, { "openat", (__SCMP_NR_BASE + 288) }, { "pause", (__SCMP_NR_BASE + 29) }, { "pciconfig_iobase", __PNR_pciconfig_iobase }, @@ -260,6 +276,8 @@ const struct arch_syscall_def mips_syscall_table[] = { \ { "pciconfig_write", __PNR_pciconfig_write }, { "perf_event_open", (__SCMP_NR_BASE + 333) }, { "personality", (__SCMP_NR_BASE + 136) }, + { "pidfd_open", (__SCMP_NR_BASE + 434) }, + { "pidfd_send_signal", (__SCMP_NR_BASE + 424) }, { "pipe", (__SCMP_NR_BASE + 42) }, { "pipe2", (__SCMP_NR_BASE + 328) }, { "pivot_root", (__SCMP_NR_BASE + 216) }, @@ -268,6 +286,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \ { "pkey_mprotect", (__SCMP_NR_BASE + 363) }, { "poll", (__SCMP_NR_BASE + 188) }, { "ppoll", (__SCMP_NR_BASE + 302) }, + { "ppoll_time64", (__SCMP_NR_BASE + 414) }, { "prctl", (__SCMP_NR_BASE + 192) }, { "pread64", (__SCMP_NR_BASE + 200) }, { "preadv", (__SCMP_NR_BASE + 330) }, @@ -278,6 +297,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \ { "prof", (__SCMP_NR_BASE + 44) }, { "profil", (__SCMP_NR_BASE + 98) }, { "pselect6", (__SCMP_NR_BASE + 301) }, + { "pselect6_time64", (__SCMP_NR_BASE + 413) }, { "ptrace", (__SCMP_NR_BASE + 26) }, { "putpmsg", (__SCMP_NR_BASE + 209) }, { "pwrite64", (__SCMP_NR_BASE + 201) }, @@ -295,6 +315,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \ { "recv", (__SCMP_NR_BASE + 175) }, { "recvfrom", (__SCMP_NR_BASE + 176) }, { "recvmmsg", (__SCMP_NR_BASE + 335) }, + { "recvmmsg_time64", (__SCMP_NR_BASE + 417) }, { "recvmsg", (__SCMP_NR_BASE + 177) }, { "remap_file_pages", (__SCMP_NR_BASE + 251) }, { "removexattr", (__SCMP_NR_BASE + 233) }, @@ -312,6 +333,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \ { "rt_sigreturn", (__SCMP_NR_BASE + 193) }, { "rt_sigsuspend", (__SCMP_NR_BASE + 199) }, { "rt_sigtimedwait", (__SCMP_NR_BASE + 197) }, + { "rt_sigtimedwait_time64", (__SCMP_NR_BASE + 421) }, { "rt_tgsigqueueinfo", (__SCMP_NR_BASE + 332) }, { "rtas", __PNR_rtas }, { "s390_guarded_storage", __PNR_s390_guarded_storage }, @@ -326,6 +348,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \ { "sched_getparam", (__SCMP_NR_BASE + 159) }, { "sched_getscheduler", (__SCMP_NR_BASE + 161) }, { "sched_rr_get_interval", (__SCMP_NR_BASE + 165) }, + { "sched_rr_get_interval_time64", (__SCMP_NR_BASE + 423) }, { "sched_setaffinity", (__SCMP_NR_BASE + 239) }, { "sched_setattr", (__SCMP_NR_BASE + 349) }, { "sched_setparam", (__SCMP_NR_BASE + 158) }, @@ -334,10 +357,11 @@ const struct arch_syscall_def mips_syscall_table[] = { \ { "seccomp", (__SCMP_NR_BASE + 352) }, { "security", __PNR_security }, { "select", __PNR_select }, - { "semctl", __PNR_semctl }, - { "semget", __PNR_semget }, + { "semctl", (__SCMP_NR_BASE + 394) }, + { "semget", (__SCMP_NR_BASE + 393) }, { "semop", __PNR_semop }, { "semtimedop", __PNR_semtimedop }, + { "semtimedop_time64", (__SCMP_NR_BASE + 420) }, { "send", (__SCMP_NR_BASE + 178) }, { "sendfile", (__SCMP_NR_BASE + 207) }, { "sendfile64", (__SCMP_NR_BASE + 237) }, @@ -379,10 +403,10 @@ const struct arch_syscall_def mips_syscall_table[] = { \ { "setuid32", __PNR_setuid32 }, { "setxattr", (__SCMP_NR_BASE + 224) }, { "sgetmask", (__SCMP_NR_BASE + 68) }, - { "shmat", __PNR_shmat }, - { "shmctl", __PNR_shmctl }, - { "shmdt", __PNR_shmdt }, - { "shmget", __PNR_shmget }, + { "shmat", (__SCMP_NR_BASE + 397) }, + { "shmctl", (__SCMP_NR_BASE + 396) }, + { "shmdt", (__SCMP_NR_BASE + 398) }, + { "shmget", (__SCMP_NR_BASE + 395) }, { "shutdown", (__SCMP_NR_BASE + 182) }, { "sigaction", (__SCMP_NR_BASE + 67) }, { "sigaltstack", (__SCMP_NR_BASE + 206) }, @@ -431,11 +455,15 @@ const struct arch_syscall_def mips_syscall_table[] = { \ { "timer_delete", (__SCMP_NR_BASE + 261) }, { "timer_getoverrun", (__SCMP_NR_BASE + 260) }, { "timer_gettime", (__SCMP_NR_BASE + 259) }, + { "timer_gettime64", (__SCMP_NR_BASE + 408) }, { "timer_settime", (__SCMP_NR_BASE + 258) }, + { "timer_settime64", (__SCMP_NR_BASE + 409) }, { "timerfd", (__SCMP_NR_BASE + 318) }, { "timerfd_create", (__SCMP_NR_BASE + 321) }, { "timerfd_gettime", (__SCMP_NR_BASE + 322) }, + { "timerfd_gettime64", (__SCMP_NR_BASE + 410) }, { "timerfd_settime", (__SCMP_NR_BASE + 323) }, + { "timerfd_settime64", (__SCMP_NR_BASE + 411) }, { "times", (__SCMP_NR_BASE + 43) }, { "tkill", (__SCMP_NR_BASE + 236) }, { "truncate", (__SCMP_NR_BASE + 92) }, @@ -457,6 +485,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \ { "ustat", (__SCMP_NR_BASE + 62) }, { "utime", (__SCMP_NR_BASE + 30) }, { "utimensat", (__SCMP_NR_BASE + 316) }, + { "utimensat_time64", (__SCMP_NR_BASE + 412) }, { "utimes", (__SCMP_NR_BASE + 267) }, { "vfork", __PNR_vfork }, { "vhangup", (__SCMP_NR_BASE + 111) }, diff --git a/src/arch-mips64-syscalls.c b/src/arch-mips64-syscalls.c index b267072..af23ff4 100644 --- a/src/arch-mips64-syscalls.c +++ b/src/arch-mips64-syscalls.c @@ -30,7 +30,7 @@ /* 64 ABI */ #define __SCMP_NR_BASE 5000 -/* NOTE: based on Linux 4.15-rc7 */ +/* NOTE: based on Linux v5.4-rc4 */ const struct arch_syscall_def mips64_syscall_table[] = { \ { "_llseek", __PNR__llseek }, { "_newselect", (__SCMP_NR_BASE + 22) }, @@ -62,11 +62,17 @@ const struct arch_syscall_def mips64_syscall_table[] = { \ { "chown32", __PNR_chown32 }, { "chroot", (__SCMP_NR_BASE + 156) }, { "clock_adjtime", (__SCMP_NR_BASE + 300) }, + { "clock_adjtime64", __PNR_clock_adjtime64 }, { "clock_getres", (__SCMP_NR_BASE + 223) }, + { "clock_getres_time64", __PNR_clock_getres_time64 }, { "clock_gettime", (__SCMP_NR_BASE + 222) }, + { "clock_gettime64", __PNR_clock_gettime64 }, { "clock_nanosleep", (__SCMP_NR_BASE + 224) }, + { "clock_nanosleep_time64", __PNR_clock_nanosleep_time64 }, { "clock_settime", (__SCMP_NR_BASE + 221) }, + { "clock_settime64", __PNR_clock_settime64 }, { "clone", (__SCMP_NR_BASE + 55) }, + { "clone3", (__SCMP_NR_BASE + 435) }, { "close", (__SCMP_NR_BASE + 3) }, { "connect", (__SCMP_NR_BASE + 41) }, { "copy_file_range", (__SCMP_NR_BASE + 320) }, @@ -110,7 +116,11 @@ const struct arch_syscall_def mips64_syscall_table[] = { \ { "flock", (__SCMP_NR_BASE + 71) }, { "fork", (__SCMP_NR_BASE + 56) }, { "fremovexattr", (__SCMP_NR_BASE + 191) }, + { "fsconfig", (__SCMP_NR_BASE + 431) }, { "fsetxattr", (__SCMP_NR_BASE + 182) }, + { "fsmount", (__SCMP_NR_BASE + 432) }, + { "fsopen", (__SCMP_NR_BASE + 430) }, + { "fspick", (__SCMP_NR_BASE + 433) }, { "fstat", (__SCMP_NR_BASE + 5) }, { "fstat64", __PNR_fstat64 }, { "fstatat64", __PNR_fstat64 }, @@ -121,6 +131,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \ { "ftruncate", (__SCMP_NR_BASE + 75) }, { "ftruncate64", __PNR_ftruncate64 }, { "futex", (__SCMP_NR_BASE + 194) }, + { "futex_time64", __PNR_futex_time64 }, { "futimesat", (__SCMP_NR_BASE + 251) }, { "get_kernel_syms", (__SCMP_NR_BASE + 170) }, { "get_mempolicy", (__SCMP_NR_BASE + 228) }, @@ -173,6 +184,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \ { "io_destroy", (__SCMP_NR_BASE + 201) }, { "io_getevents", (__SCMP_NR_BASE + 202) }, { "io_pgetevents", (__SCMP_NR_BASE + 328) }, + { "io_pgetevents_time64", __PNR_io_pgetevents_time64 }, { "io_setup", (__SCMP_NR_BASE + 200) }, { "io_submit", (__SCMP_NR_BASE + 203) }, { "io_uring_setup", (__SCMP_NR_BASE + 425) }, @@ -221,6 +233,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \ { "mmap2", __PNR_mmap2 }, { "modify_ldt", __PNR_modify_ldt }, { "mount", (__SCMP_NR_BASE + 160) }, + { "move_mount", (__SCMP_NR_BASE + 429) }, { "move_pages", (__SCMP_NR_BASE + 267) }, { "mprotect", (__SCMP_NR_BASE + 10) }, { "mpx", __PNR_mpx }, @@ -228,7 +241,9 @@ const struct arch_syscall_def mips64_syscall_table[] = { \ { "mq_notify", (__SCMP_NR_BASE + 234) }, { "mq_open", (__SCMP_NR_BASE + 230) }, { "mq_timedreceive", (__SCMP_NR_BASE + 233) }, + { "mq_timedreceive_time64", __PNR_mq_timedreceive_time64 }, { "mq_timedsend", (__SCMP_NR_BASE + 232) }, + { "mq_timedsend_time64", __PNR_mq_timedsend_time64 }, { "mq_unlink", (__SCMP_NR_BASE + 231) }, { "mremap", (__SCMP_NR_BASE + 24) }, { "msgctl", (__SCMP_NR_BASE + 69) }, @@ -253,6 +268,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \ { "oldwait4", __PNR_oldwait4 }, { "open", (__SCMP_NR_BASE + 2) }, { "open_by_handle_at", (__SCMP_NR_BASE + 299) }, + { "open_tree", (__SCMP_NR_BASE + 428) }, { "openat", (__SCMP_NR_BASE + 247) }, { "pause", (__SCMP_NR_BASE + 33) }, { "pciconfig_iobase", __PNR_pciconfig_iobase }, @@ -260,6 +276,8 @@ const struct arch_syscall_def mips64_syscall_table[] = { \ { "pciconfig_write", __PNR_pciconfig_write }, { "perf_event_open", (__SCMP_NR_BASE + 292) }, { "personality", (__SCMP_NR_BASE + 132) }, + { "pidfd_open", (__SCMP_NR_BASE + 434) }, + { "pidfd_send_signal", (__SCMP_NR_BASE + 424) }, { "pipe", (__SCMP_NR_BASE + 21) }, { "pipe2", (__SCMP_NR_BASE + 287) }, { "pivot_root", (__SCMP_NR_BASE + 151) }, @@ -268,6 +286,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \ { "pkey_mprotect", (__SCMP_NR_BASE + 323) }, { "poll", (__SCMP_NR_BASE + 7) }, { "ppoll", (__SCMP_NR_BASE + 261) }, + { "ppoll_time64", __PNR_ppoll_time64 }, { "prctl", (__SCMP_NR_BASE + 153) }, { "pread64", (__SCMP_NR_BASE + 16) }, { "preadv", (__SCMP_NR_BASE + 289) }, @@ -278,6 +297,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \ { "prof", __PNR_prof }, { "profil", __PNR_profil }, { "pselect6", (__SCMP_NR_BASE + 260) }, + { "pselect6_time64", __PNR_pselect6_time64 }, { "ptrace", (__SCMP_NR_BASE + 99) }, { "putpmsg", (__SCMP_NR_BASE + 175) }, { "pwrite64", (__SCMP_NR_BASE + 17) }, @@ -295,6 +315,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \ { "recv", __PNR_recv }, { "recvfrom", (__SCMP_NR_BASE + 44) }, { "recvmmsg", (__SCMP_NR_BASE + 294) }, + { "recvmmsg_time64", __PNR_recvmmsg_time64 }, { "recvmsg", (__SCMP_NR_BASE + 46) }, { "remap_file_pages", (__SCMP_NR_BASE + 210) }, { "removexattr", (__SCMP_NR_BASE + 189) }, @@ -312,6 +333,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \ { "rt_sigreturn", (__SCMP_NR_BASE + 211) }, { "rt_sigsuspend", (__SCMP_NR_BASE + 128) }, { "rt_sigtimedwait", (__SCMP_NR_BASE + 126) }, + { "rt_sigtimedwait_time64", __PNR_rt_sigtimedwait_time64 }, { "rt_tgsigqueueinfo", (__SCMP_NR_BASE + 291) }, { "rtas", __PNR_rtas }, { "s390_guarded_storage", __PNR_s390_guarded_storage }, @@ -326,6 +348,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \ { "sched_getparam", (__SCMP_NR_BASE + 140) }, { "sched_getscheduler", (__SCMP_NR_BASE + 142) }, { "sched_rr_get_interval", (__SCMP_NR_BASE + 145) }, + { "sched_rr_get_interval_time64", __PNR_sched_rr_get_interval_time64 }, { "sched_setaffinity", (__SCMP_NR_BASE + 195) }, { "sched_setattr", (__SCMP_NR_BASE + 309) }, { "sched_setparam", (__SCMP_NR_BASE + 139) }, @@ -338,6 +361,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \ { "semget", (__SCMP_NR_BASE + 62) }, { "semop", (__SCMP_NR_BASE + 63) }, { "semtimedop", (__SCMP_NR_BASE + 214) }, + { "semtimedop_time64", __PNR_semtimedop_time64 }, { "send", __PNR_send }, { "sendfile", (__SCMP_NR_BASE + 39) }, { "sendfile64", __PNR_sendfile64 }, @@ -431,11 +455,15 @@ const struct arch_syscall_def mips64_syscall_table[] = { \ { "timer_delete", (__SCMP_NR_BASE + 220) }, { "timer_getoverrun", (__SCMP_NR_BASE + 219) }, { "timer_gettime", (__SCMP_NR_BASE + 218) }, + { "timer_gettime64", __PNR_timer_gettime64 }, { "timer_settime", (__SCMP_NR_BASE + 217) }, + { "timer_settime64", __PNR_timer_settime64 }, { "timerfd", (__SCMP_NR_BASE + 277) }, { "timerfd_create", (__SCMP_NR_BASE + 280) }, { "timerfd_gettime", (__SCMP_NR_BASE + 281) }, + { "timerfd_gettime64", __PNR_timerfd_gettime64 }, { "timerfd_settime", (__SCMP_NR_BASE + 282) }, + { "timerfd_settime64", __PNR_timerfd_settime64 }, { "times", (__SCMP_NR_BASE + 98) }, { "tkill", (__SCMP_NR_BASE + 192) }, { "truncate", (__SCMP_NR_BASE + 74) }, @@ -457,6 +485,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \ { "ustat", (__SCMP_NR_BASE + 133) }, { "utime", (__SCMP_NR_BASE + 130) }, { "utimensat", (__SCMP_NR_BASE + 275) }, + { "utimensat_time64", __PNR_utimensat_time64 }, { "utimes", (__SCMP_NR_BASE + 226) }, { "vfork", __PNR_vfork }, { "vhangup", (__SCMP_NR_BASE + 150) }, diff --git a/src/arch-mips64n32-syscalls.c b/src/arch-mips64n32-syscalls.c index 8af6b3e..2159bcc 100644 --- a/src/arch-mips64n32-syscalls.c +++ b/src/arch-mips64n32-syscalls.c @@ -30,7 +30,7 @@ /* N32 ABI */ #define __SCMP_NR_BASE 6000 -/* NOTE: based on Linux 4.15-rc7 */ +/* NOTE: based on Linux v5.4-rc4 */ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "_llseek", __PNR__llseek }, { "_newselect", (__SCMP_NR_BASE + 22) }, @@ -62,11 +62,17 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "chown32", __PNR_chown32 }, { "chroot", (__SCMP_NR_BASE + 156) }, { "clock_adjtime", (__SCMP_NR_BASE + 305) }, + { "clock_adjtime64", (__SCMP_NR_BASE + 405) }, { "clock_getres", (__SCMP_NR_BASE + 227) }, + { "clock_getres_time64", (__SCMP_NR_BASE + 406) }, { "clock_gettime", (__SCMP_NR_BASE + 226) }, + { "clock_gettime64", (__SCMP_NR_BASE + 403) }, { "clock_nanosleep", (__SCMP_NR_BASE + 228) }, + { "clock_nanosleep_time64", (__SCMP_NR_BASE + 407) }, { "clock_settime", (__SCMP_NR_BASE + 225) }, + { "clock_settime64", (__SCMP_NR_BASE + 404) }, { "clone", (__SCMP_NR_BASE + 55) }, + { "clone3", (__SCMP_NR_BASE + 435) }, { "close", (__SCMP_NR_BASE + 3) }, { "connect", (__SCMP_NR_BASE + 41) }, { "copy_file_range", (__SCMP_NR_BASE + 324) }, @@ -110,7 +116,11 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "flock", (__SCMP_NR_BASE + 71) }, { "fork", (__SCMP_NR_BASE + 56) }, { "fremovexattr", (__SCMP_NR_BASE + 191) }, + { "fsconfig", (__SCMP_NR_BASE + 431) }, { "fsetxattr", (__SCMP_NR_BASE + 182) }, + { "fsmount", (__SCMP_NR_BASE + 432) }, + { "fsopen", (__SCMP_NR_BASE + 430) }, + { "fspick", (__SCMP_NR_BASE + 433) }, { "fstat", (__SCMP_NR_BASE + 5) }, { "fstat64", __PNR_fstat64 }, { "fstatat64", __PNR_fstat64 }, @@ -121,6 +131,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "ftruncate", (__SCMP_NR_BASE + 75) }, { "ftruncate64", __PNR_ftruncate64 }, { "futex", (__SCMP_NR_BASE + 194) }, + { "futex_time64", (__SCMP_NR_BASE + 422) }, { "futimesat", (__SCMP_NR_BASE + 255) }, { "get_kernel_syms", (__SCMP_NR_BASE + 170) }, { "get_mempolicy", (__SCMP_NR_BASE + 232) }, @@ -173,6 +184,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "io_destroy", (__SCMP_NR_BASE + 201) }, { "io_getevents", (__SCMP_NR_BASE + 202) }, { "io_pgetevents", (__SCMP_NR_BASE + 332) }, + { "io_pgetevents_time64", (__SCMP_NR_BASE + 416) }, { "io_setup", (__SCMP_NR_BASE + 200) }, { "io_submit", (__SCMP_NR_BASE + 203) }, { "io_uring_setup", (__SCMP_NR_BASE + 425) }, @@ -221,6 +233,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "mmap2", __PNR_mmap2 }, { "modify_ldt", __PNR_modify_ldt }, { "mount", (__SCMP_NR_BASE + 160) }, + { "move_mount", (__SCMP_NR_BASE + 429) }, { "move_pages", (__SCMP_NR_BASE + 271) }, { "mprotect", (__SCMP_NR_BASE + 10) }, { "mpx", __PNR_mpx }, @@ -228,7 +241,9 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "mq_notify", (__SCMP_NR_BASE + 238) }, { "mq_open", (__SCMP_NR_BASE + 234) }, { "mq_timedreceive", (__SCMP_NR_BASE + 237) }, + { "mq_timedreceive_time64", (__SCMP_NR_BASE + 419) }, { "mq_timedsend", (__SCMP_NR_BASE + 236) }, + { "mq_timedsend_time64", (__SCMP_NR_BASE + 418) }, { "mq_unlink", (__SCMP_NR_BASE + 235) }, { "mremap", (__SCMP_NR_BASE + 24) }, { "msgctl", (__SCMP_NR_BASE + 69) }, @@ -253,6 +268,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "oldwait4", __PNR_oldwait4 }, { "open", (__SCMP_NR_BASE + 2) }, { "open_by_handle_at", (__SCMP_NR_BASE + 304) }, + { "open_tree", (__SCMP_NR_BASE + 428) }, { "openat", (__SCMP_NR_BASE + 251) }, { "pause", (__SCMP_NR_BASE + 33) }, { "pciconfig_iobase", __PNR_pciconfig_iobase }, @@ -260,6 +276,8 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "pciconfig_write", __PNR_pciconfig_write }, { "perf_event_open", (__SCMP_NR_BASE + 296) }, { "personality", (__SCMP_NR_BASE + 132) }, + { "pidfd_open", (__SCMP_NR_BASE + 434) }, + { "pidfd_send_signal", (__SCMP_NR_BASE + 424) }, { "pipe", (__SCMP_NR_BASE + 21) }, { "pipe2", (__SCMP_NR_BASE + 291) }, { "pivot_root", (__SCMP_NR_BASE + 151) }, @@ -268,6 +286,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "pkey_mprotect", (__SCMP_NR_BASE + 327) }, { "poll", (__SCMP_NR_BASE + 7) }, { "ppoll", (__SCMP_NR_BASE + 265) }, + { "ppoll_time64", (__SCMP_NR_BASE + 414) }, { "prctl", (__SCMP_NR_BASE + 153) }, { "pread64", (__SCMP_NR_BASE + 16) }, { "preadv", (__SCMP_NR_BASE + 293) }, @@ -278,6 +297,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "prof", __PNR_prof }, { "profil", __PNR_profil }, { "pselect6", (__SCMP_NR_BASE + 264) }, + { "pselect6_time64", (__SCMP_NR_BASE + 413) }, { "ptrace", (__SCMP_NR_BASE + 99) }, { "putpmsg", (__SCMP_NR_BASE + 175) }, { "pwrite64", (__SCMP_NR_BASE + 17) }, @@ -295,6 +315,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "recv", __PNR_recv }, { "recvfrom", (__SCMP_NR_BASE + 44) }, { "recvmmsg", (__SCMP_NR_BASE + 298) }, + { "recvmmsg_time64", (__SCMP_NR_BASE + 417) }, { "recvmsg", (__SCMP_NR_BASE + 46) }, { "remap_file_pages", (__SCMP_NR_BASE + 210) }, { "removexattr", (__SCMP_NR_BASE + 189) }, @@ -312,6 +333,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "rt_sigreturn", (__SCMP_NR_BASE + 211) }, { "rt_sigsuspend", (__SCMP_NR_BASE + 128) }, { "rt_sigtimedwait", (__SCMP_NR_BASE + 126) }, + { "rt_sigtimedwait_time64", (__SCMP_NR_BASE + 421) }, { "rt_tgsigqueueinfo", (__SCMP_NR_BASE + 295) }, { "rtas", __PNR_rtas }, { "s390_guarded_storage", __PNR_s390_guarded_storage }, @@ -326,6 +348,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "sched_getparam", (__SCMP_NR_BASE + 140) }, { "sched_getscheduler", (__SCMP_NR_BASE + 142) }, { "sched_rr_get_interval", (__SCMP_NR_BASE + 145) }, + { "sched_rr_get_interval_time64", (__SCMP_NR_BASE + 423) }, { "sched_setaffinity", (__SCMP_NR_BASE + 195) }, { "sched_setattr", (__SCMP_NR_BASE + 313) }, { "sched_setparam", (__SCMP_NR_BASE + 139) }, @@ -338,6 +361,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "semget", (__SCMP_NR_BASE + 62) }, { "semop", (__SCMP_NR_BASE + 63) }, { "semtimedop", (__SCMP_NR_BASE + 215) }, + { "semtimedop_time64", (__SCMP_NR_BASE + 420) }, { "send", __PNR_send }, { "sendfile", (__SCMP_NR_BASE + 39) }, { "sendfile64", (__SCMP_NR_BASE + 219) }, @@ -431,11 +455,15 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "timer_delete", (__SCMP_NR_BASE + 224) }, { "timer_getoverrun", (__SCMP_NR_BASE + 223) }, { "timer_gettime", (__SCMP_NR_BASE + 222) }, + { "timer_gettime64", (__SCMP_NR_BASE + 408) }, { "timer_settime", (__SCMP_NR_BASE + 221) }, + { "timer_settime64", (__SCMP_NR_BASE + 409) }, { "timerfd", (__SCMP_NR_BASE + 281) }, { "timerfd_create", (__SCMP_NR_BASE + 284) }, { "timerfd_gettime", (__SCMP_NR_BASE + 285) }, + { "timerfd_gettime64", (__SCMP_NR_BASE + 410) }, { "timerfd_settime", (__SCMP_NR_BASE + 286) }, + { "timerfd_settime64", (__SCMP_NR_BASE + 411) }, { "times", (__SCMP_NR_BASE + 98) }, { "tkill", (__SCMP_NR_BASE + 192) }, { "truncate", (__SCMP_NR_BASE + 74) }, @@ -457,6 +485,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \ { "ustat", (__SCMP_NR_BASE + 133) }, { "utime", (__SCMP_NR_BASE + 130) }, { "utimensat", (__SCMP_NR_BASE + 279) }, + { "utimensat_time64", (__SCMP_NR_BASE + 412) }, { "utimes", (__SCMP_NR_BASE + 230) }, { "vfork", __PNR_vfork }, { "vhangup", (__SCMP_NR_BASE + 150) }, diff --git a/src/arch-parisc-syscalls.c b/src/arch-parisc-syscalls.c index 8f19a03..c516c16 100644 --- a/src/arch-parisc-syscalls.c +++ b/src/arch-parisc-syscalls.c @@ -10,7 +10,7 @@ #include "arch.h" #include "arch-parisc.h" -/* NOTE: based on Linux 4.15-rc7 */ +/* NOTE: based on Linux v5.4-rc4 */ const struct arch_syscall_def parisc_syscall_table[] = { \ { "_llseek", 140 }, { "_newselect", 142 }, @@ -42,11 +42,17 @@ const struct arch_syscall_def parisc_syscall_table[] = { \ { "chown32", __PNR_chown32 }, { "chroot", 61 }, { "clock_adjtime", 324 }, + { "clock_adjtime64", __PNR_clock_adjtime64 }, { "clock_getres", 257 }, + { "clock_getres_time64", __PNR_clock_getres_time64 }, { "clock_gettime", 256 }, + { "clock_gettime64", __PNR_clock_gettime64 }, { "clock_nanosleep", 258 }, + { "clock_nanosleep_time64", __PNR_clock_nanosleep_time64 }, { "clock_settime", 255 }, + { "clock_settime64", __PNR_clock_settime64 }, { "clone", 120 }, + { "clone3", __PNR_clone3 }, { "close", 6 }, { "connect", 31 }, { "copy_file_range", 346 }, @@ -90,7 +96,11 @@ const struct arch_syscall_def parisc_syscall_table[] = { \ { "flock", 143 }, { "fork", 2 }, { "fremovexattr", 249 }, + { "fsconfig", __PNR_fsconfig }, { "fsetxattr", 240 }, + { "fsmount", __PNR_fsmount }, + { "fsopen", __PNR_fsopen }, + { "fspick", __PNR_fspick }, { "fstat", 28 }, { "fstat64", 112 }, { "fstatat64", 280 }, @@ -101,6 +111,7 @@ const struct arch_syscall_def parisc_syscall_table[] = { \ { "ftruncate", 93 }, { "ftruncate64", 200 }, { "futex", 210 }, + { "futex_time64", __PNR_futex_time64 }, { "futimesat", 279 }, { "get_kernel_syms", 130 }, { "get_mempolicy", 261 }, @@ -152,7 +163,8 @@ const struct arch_syscall_def parisc_syscall_table[] = { \ { "io_cancel", 219 }, { "io_destroy", 216 }, { "io_getevents", 217 }, - { "io_pgetevents", __PNR_io_pgetevents }, + { "io_pgetevents", __PNR_io_pgetevents }, + { "io_pgetevents_time64", __PNR_io_pgetevents_time64 }, { "io_setup", 215 }, { "io_submit", 218 }, { "io_uring_setup", 425 }, @@ -201,6 +213,7 @@ const struct arch_syscall_def parisc_syscall_table[] = { \ { "mmap2", 89 }, { "modify_ldt", __PNR_modify_ldt }, { "mount", 21 }, + { "move_mount", __PNR_move_mount }, { "move_pages", 295 }, { "mprotect", 125 }, { "mpx", __PNR_mpx }, @@ -208,7 +221,9 @@ const struct arch_syscall_def parisc_syscall_table[] = { \ { "mq_notify", 233 }, { "mq_open", 229 }, { "mq_timedreceive", 232 }, + { "mq_timedreceive_time64", __PNR_mq_timedreceive_time64 }, { "mq_timedsend", 231 }, + { "mq_timedsend_time64", __PNR_mq_timedsend_time64 }, { "mq_unlink", 230 }, { "mremap", 163 }, { "msgctl", 191 }, @@ -233,6 +248,7 @@ const struct arch_syscall_def parisc_syscall_table[] = { \ { "oldwait4", __PNR_oldwait4 }, { "open", 5 }, { "open_by_handle_at", 326 }, + { "open_tree", __PNR_open_tree }, { "openat", 275 }, { "pause", 29 }, { "pciconfig_iobase", __PNR_pciconfig_iobase }, @@ -240,6 +256,8 @@ const struct arch_syscall_def parisc_syscall_table[] = { \ { "pciconfig_write", __PNR_pciconfig_write }, { "perf_event_open", 318 }, { "personality", 136 }, + { "pidfd_open", __PNR_pidfd_open }, + { "pidfd_send_signal", __PNR_pidfd_send_signal }, { "pipe", 42 }, { "pipe2", 313 }, { "pivot_root", 67 }, @@ -248,6 +266,7 @@ const struct arch_syscall_def parisc_syscall_table[] = { \ { "pkey_mprotect", __PNR_pkey_mprotect }, { "poll", 168 }, { "ppoll", 274 }, + { "ppoll_time64", __PNR_ppoll_time64 }, { "prctl", 172 }, { "pread64", 108 }, { "preadv", 315 }, @@ -258,6 +277,7 @@ const struct arch_syscall_def parisc_syscall_table[] = { \ { "prof", __PNR_prof }, { "profil", __PNR_profil }, { "pselect6", 273 }, + { "pselect6_time64", __PNR_pselect6_time64 }, { "ptrace", 26 }, { "putpmsg", 197 }, { "pwrite64", 109 }, @@ -275,6 +295,7 @@ const struct arch_syscall_def parisc_syscall_table[] = { \ { "recv", 98 }, { "recvfrom", 123 }, { "recvmmsg", 319 }, + { "recvmmsg_time64", __PNR_recvmmsg_time64 }, { "recvmsg", 184 }, { "remap_file_pages", 227 }, { "removexattr", 247 }, @@ -292,6 +313,7 @@ const struct arch_syscall_def parisc_syscall_table[] = { \ { "rt_sigreturn", 173 }, { "rt_sigsuspend", 179 }, { "rt_sigtimedwait", 177 }, + { "rt_sigtimedwait_time64", __PNR_rt_sigtimedwait_time64 }, { "rt_tgsigqueueinfo", 317 }, { "rtas", __PNR_rtas }, { "s390_guarded_storage", __PNR_s390_guarded_storage }, @@ -306,6 +328,7 @@ const struct arch_syscall_def parisc_syscall_table[] = { \ { "sched_getparam", 155 }, { "sched_getscheduler", 157 }, { "sched_rr_get_interval", 161 }, + { "sched_rr_get_interval_time64", __PNR_sched_rr_get_interval_time64 }, { "sched_setaffinity", 211 }, { "sched_setattr", 334 }, { "sched_setparam", 154 }, @@ -318,6 +341,7 @@ const struct arch_syscall_def parisc_syscall_table[] = { \ { "semget", 186 }, { "semop", 185 }, { "semtimedop", 228 }, + { "semtimedop_time64", __PNR_semtimedop_time64 }, { "send", 58 }, { "sendfile", 122 }, { "sendfile64", 209 }, @@ -411,11 +435,15 @@ const struct arch_syscall_def parisc_syscall_table[] = { \ { "timer_delete", 254 }, { "timer_getoverrun", 253 }, { "timer_gettime", 252 }, + { "timer_gettime64", __PNR_timer_gettime64 }, { "timer_settime", 251 }, + { "timer_settime64", __PNR_timer_settime64 }, { "timerfd", 303 }, { "timerfd_create", 306 }, { "timerfd_gettime", 308 }, + { "timerfd_gettime64", __PNR_timerfd_gettime64 }, { "timerfd_settime", 307 }, + { "timerfd_settime64", __PNR_timerfd_settime64 }, { "times", 43 }, { "tkill", 208 }, { "truncate", 92 }, @@ -437,6 +465,7 @@ const struct arch_syscall_def parisc_syscall_table[] = { \ { "ustat", 62 }, { "utime", 30 }, { "utimensat", 301 }, + { "utimensat_time64", __PNR_utimensat_time64 }, { "utimes", 336 }, { "vfork", 113 }, { "vhangup", 111 }, diff --git a/src/arch-ppc-syscalls.c b/src/arch-ppc-syscalls.c index 8275b38..fbfa1df 100644 --- a/src/arch-ppc-syscalls.c +++ b/src/arch-ppc-syscalls.c @@ -27,7 +27,7 @@ #include "arch.h" #include "arch-ppc.h" -/* NOTE: based on Linux 4.15-rc7 */ +/* NOTE: based on Linux v5.4-rc4 */ const struct arch_syscall_def ppc_syscall_table[] = { \ { "_llseek", 140 }, { "_newselect", 142 }, @@ -59,11 +59,17 @@ const struct arch_syscall_def ppc_syscall_table[] = { \ { "chown32", __PNR_chown32 }, { "chroot", 61 }, { "clock_adjtime", 347 }, + { "clock_adjtime64", 405 }, { "clock_getres", 247 }, + { "clock_getres_time64", 406 }, { "clock_gettime", 246 }, + { "clock_gettime64", 403 }, { "clock_nanosleep", 248 }, + { "clock_nanosleep_time64", 407 }, { "clock_settime", 245 }, + { "clock_settime64", 404 }, { "clone", 120 }, + { "clone3", 435 }, { "close", 6 }, { "connect", 328 }, { "copy_file_range", 379 }, @@ -107,7 +113,11 @@ const struct arch_syscall_def ppc_syscall_table[] = { \ { "flock", 143 }, { "fork", 2 }, { "fremovexattr", 220 }, + { "fsconfig", 431 }, { "fsetxattr", 211 }, + { "fsmount", 432 }, + { "fsopen", 430 }, + { "fspick", 433 }, { "fstat", 108 }, { "fstat64", 197 }, { "fstatat64", 291 }, @@ -118,6 +128,7 @@ const struct arch_syscall_def ppc_syscall_table[] = { \ { "ftruncate", 93 }, { "ftruncate64", 194 }, { "futex", 221 }, + { "futex_time64", 422 }, { "futimesat", 290 }, { "get_kernel_syms", 130 }, { "get_mempolicy", 260 }, @@ -170,6 +181,7 @@ const struct arch_syscall_def ppc_syscall_table[] = { \ { "io_destroy", 228 }, { "io_getevents", 229 }, { "io_pgetevents", 388 }, + { "io_pgetevents_time64", 416 }, { "io_setup", 227 }, { "io_submit", 230 }, { "io_uring_setup", 425 }, @@ -218,6 +230,7 @@ const struct arch_syscall_def ppc_syscall_table[] = { \ { "mmap2", 192 }, { "modify_ldt", 123 }, { "mount", 21 }, + { "move_mount", 429 }, { "move_pages", 301 }, { "mprotect", 125 }, { "mpx", 56 }, @@ -225,13 +238,15 @@ const struct arch_syscall_def ppc_syscall_table[] = { \ { "mq_notify", 266 }, { "mq_open", 262 }, { "mq_timedreceive", 265 }, + { "mq_timedreceive_time64", 419 }, { "mq_timedsend", 264 }, + { "mq_timedsend_time64", 418 }, { "mq_unlink", 263 }, { "mremap", 163 }, - { "msgctl", __PNR_msgctl }, - { "msgget", __PNR_msgget }, - { "msgrcv", __PNR_msgrcv }, - { "msgsnd", __PNR_msgsnd }, + { "msgctl", 402 }, + { "msgget", 399 }, + { "msgrcv", 401 }, + { "msgsnd", 400 }, { "msync", 144 }, { "multiplexer", 201 }, { "munlock", 151 }, @@ -250,6 +265,7 @@ const struct arch_syscall_def ppc_syscall_table[] = { \ { "oldwait4", __PNR_oldwait4 }, { "open", 5 }, { "open_by_handle_at", 346 }, + { "open_tree", 428 }, { "openat", 286 }, { "pause", 29 }, { "pciconfig_iobase", 200 }, @@ -257,6 +273,8 @@ const struct arch_syscall_def ppc_syscall_table[] = { \ { "pciconfig_write", 199 }, { "perf_event_open", 319 }, { "personality", 136 }, + { "pidfd_open", 434 }, + { "pidfd_send_signal", 424 }, { "pipe", 42 }, { "pipe2", 317 }, { "pivot_root", 203 }, @@ -265,6 +283,7 @@ const struct arch_syscall_def ppc_syscall_table[] = { \ { "pkey_mprotect", 386 }, { "poll", 167 }, { "ppoll", 281 }, + { "ppoll_time64", 414 }, { "prctl", 171 }, { "pread64", 179 }, { "preadv", 320 }, @@ -275,6 +294,7 @@ const struct arch_syscall_def ppc_syscall_table[] = { \ { "prof", 44 }, { "profil", 98 }, { "pselect6", 280 }, + { "pselect6_time64", 413 }, { "ptrace", 26 }, { "putpmsg", 188 }, { "pwrite64", 180 }, @@ -292,6 +312,7 @@ const struct arch_syscall_def ppc_syscall_table[] = { \ { "recv", 336 }, { "recvfrom", 337 }, { "recvmmsg", 343 }, + { "recvmmsg_time64", 417 }, { "recvmsg", 342 }, { "remap_file_pages", 239 }, { "removexattr", 218 }, @@ -309,6 +330,7 @@ const struct arch_syscall_def ppc_syscall_table[] = { \ { "rt_sigreturn", 172 }, { "rt_sigsuspend", 178 }, { "rt_sigtimedwait", 176 }, + { "rt_sigtimedwait_time64", 421 }, { "rt_tgsigqueueinfo", 322 }, { "rtas", 255 }, { "s390_guarded_storage", __PNR_s390_guarded_storage }, @@ -323,6 +345,7 @@ const struct arch_syscall_def ppc_syscall_table[] = { \ { "sched_getparam", 155 }, { "sched_getscheduler", 157 }, { "sched_rr_get_interval", 161 }, + { "sched_rr_get_interval_time64", 423 }, { "sched_setaffinity", 222 }, { "sched_setattr", 355 }, { "sched_setparam", 154 }, @@ -331,10 +354,11 @@ const struct arch_syscall_def ppc_syscall_table[] = { \ { "seccomp", 358 }, { "security", __PNR_security }, { "select", 82 }, - { "semctl", __PNR_semctl }, - { "semget", __PNR_semget }, + { "semctl", 394 }, + { "semget", 393 }, { "semop", __PNR_semop }, { "semtimedop", __PNR_semtimedop }, + { "semtimedop_time64", 420 }, { "send", 334 }, { "sendfile", 186 }, { "sendfile64", 226 }, @@ -376,10 +400,10 @@ const struct arch_syscall_def ppc_syscall_table[] = { \ { "setuid32", __PNR_setuid32 }, { "setxattr", 209 }, { "sgetmask", 68 }, - { "shmat", __PNR_shmat }, - { "shmctl", __PNR_shmctl }, - { "shmdt", __PNR_shmdt }, - { "shmget", __PNR_shmget }, + { "shmat", 397 }, + { "shmctl", 396 }, + { "shmdt", 398 }, + { "shmget", 395 }, { "shutdown", 338 }, { "sigaction", 67 }, { "sigaltstack", 185 }, @@ -428,11 +452,15 @@ const struct arch_syscall_def ppc_syscall_table[] = { \ { "timer_delete", 244 }, { "timer_getoverrun", 243 }, { "timer_gettime", 242 }, + { "timer_gettime64", 408 }, { "timer_settime", 241 }, + { "timer_settime64", 409 }, { "timerfd", __PNR_timerfd }, { "timerfd_create", 306 }, { "timerfd_gettime", 312 }, + { "timerfd_gettime64", 410 }, { "timerfd_settime", 311 }, + { "timerfd_settime64", 411 }, { "times", 43 }, { "tkill", 208 }, { "truncate", 92 }, @@ -454,6 +482,7 @@ const struct arch_syscall_def ppc_syscall_table[] = { \ { "ustat", 62 }, { "utime", 30 }, { "utimensat", 304 }, + { "utimensat_time64", 412 }, { "utimes", 251 }, { "vfork", 189 }, { "vhangup", 111 }, diff --git a/src/arch-ppc64-syscalls.c b/src/arch-ppc64-syscalls.c index 2a8f387..41f82af 100644 --- a/src/arch-ppc64-syscalls.c +++ b/src/arch-ppc64-syscalls.c @@ -27,7 +27,7 @@ #include "arch.h" #include "arch-ppc64.h" -/* NOTE: based on Linux 4.15-rc7 */ +/* NOTE: based on Linux v5.4-rc4 */ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "_llseek", 140 }, { "_newselect", 142 }, @@ -59,11 +59,17 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "chown32", __PNR_chown32 }, { "chroot", 61 }, { "clock_adjtime", 347 }, + { "clock_adjtime64", __PNR_clock_adjtime64 }, { "clock_getres", 247 }, + { "clock_getres_time64", __PNR_clock_getres_time64 }, { "clock_gettime", 246 }, + { "clock_gettime64", __PNR_clock_gettime64 }, { "clock_nanosleep", 248 }, + { "clock_nanosleep_time64", __PNR_clock_nanosleep_time64 }, { "clock_settime", 245 }, + { "clock_settime64", __PNR_clock_settime64 }, { "clone", 120 }, + { "clone3", 435 }, { "close", 6 }, { "connect", 328 }, { "copy_file_range", 379 }, @@ -107,7 +113,11 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "flock", 143 }, { "fork", 2 }, { "fremovexattr", 220 }, + { "fsconfig", 431 }, { "fsetxattr", 211 }, + { "fsmount", 432 }, + { "fsopen", 430 }, + { "fspick", 433 }, { "fstat", 108 }, { "fstat64", __PNR_fstat64 }, { "fstatat64", __PNR_fstatat64 }, @@ -118,6 +128,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "ftruncate", 93 }, { "ftruncate64", __PNR_ftruncate64 }, { "futex", 221 }, + { "futex_time64", __PNR_futex_time64 }, { "futimesat", 290 }, { "get_kernel_syms", 130 }, { "get_mempolicy", 260 }, @@ -170,6 +181,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "io_destroy", 228 }, { "io_getevents", 229 }, { "io_pgetevents", 388 }, + { "io_pgetevents_time64", __PNR_io_pgetevents_time64 }, { "io_setup", 227 }, { "io_submit", 230 }, { "io_uring_setup", 425 }, @@ -218,6 +230,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "mmap2", __PNR_mmap2 }, { "modify_ldt", 123 }, { "mount", 21 }, + { "move_mount", 429 }, { "move_pages", 301 }, { "mprotect", 125 }, { "mpx", 56 }, @@ -225,13 +238,15 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "mq_notify", 266 }, { "mq_open", 262 }, { "mq_timedreceive", 265 }, + { "mq_timedreceive_time64", __PNR_mq_timedreceive_time64 }, { "mq_timedsend", 264 }, + { "mq_timedsend_time64", __PNR_mq_timedsend_time64 }, { "mq_unlink", 263 }, { "mremap", 163 }, - { "msgctl", __PNR_msgctl }, - { "msgget", __PNR_msgget }, - { "msgrcv", __PNR_msgrcv }, - { "msgsnd", __PNR_msgsnd }, + { "msgctl", 402 }, + { "msgget", 399 }, + { "msgrcv", 401 }, + { "msgsnd", 400 }, { "msync", 144 }, { "multiplexer", 201 }, { "munlock", 151 }, @@ -250,6 +265,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "oldwait4", __PNR_oldwait4 }, { "open", 5 }, { "open_by_handle_at", 346 }, + { "open_tree", 428 }, { "openat", 286 }, { "pause", 29 }, { "pciconfig_iobase", 200 }, @@ -257,6 +273,8 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "pciconfig_write", 199 }, { "perf_event_open", 319 }, { "personality", 136 }, + { "pidfd_open", 434 }, + { "pidfd_send_signal", 424 }, { "pipe", 42 }, { "pipe2", 317 }, { "pivot_root", 203 }, @@ -265,6 +283,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "pkey_mprotect", 386 }, { "poll", 167 }, { "ppoll", 281 }, + { "ppoll_time64", __PNR_ppoll_time64 }, { "prctl", 171 }, { "pread64", 179 }, { "preadv", 320 }, @@ -275,6 +294,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "prof", 44 }, { "profil", 98 }, { "pselect6", 280 }, + { "pselect6_time64", __PNR_pselect6_time64 }, { "ptrace", 26 }, { "putpmsg", 188 }, { "pwrite64", 180 }, @@ -292,6 +312,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "recv", 336 }, { "recvfrom", 337 }, { "recvmmsg", 343 }, + { "recvmmsg_time64", __PNR_recvmmsg_time64 }, { "recvmsg", 342 }, { "remap_file_pages", 239 }, { "removexattr", 218 }, @@ -309,6 +330,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "rt_sigreturn", 172 }, { "rt_sigsuspend", 178 }, { "rt_sigtimedwait", 176 }, + { "rt_sigtimedwait_time64", __PNR_rt_sigtimedwait_time64 }, { "rt_tgsigqueueinfo", 322 }, { "rtas", 255 }, { "s390_guarded_storage", __PNR_s390_guarded_storage }, @@ -323,6 +345,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "sched_getparam", 155 }, { "sched_getscheduler", 157 }, { "sched_rr_get_interval", 161 }, + { "sched_rr_get_interval_time64", __PNR_sched_rr_get_interval_time64 }, { "sched_setaffinity", 222 }, { "sched_setattr", 355 }, { "sched_setparam", 154 }, @@ -331,10 +354,11 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "seccomp", 358 }, { "security", __PNR_security }, { "select", 82 }, - { "semctl", __PNR_semctl }, - { "semget", __PNR_semget }, + { "semctl", 394 }, + { "semget", 393 }, { "semop", __PNR_semop }, - { "semtimedop", __PNR_semtimedop }, + { "semtimedop", 392 }, + { "semtimedop_time64", __PNR_semtimedop_time64 }, { "send", 334 }, { "sendfile", 186 }, { "sendfile64", __PNR_sendfile64 }, @@ -376,10 +400,10 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "setuid32", __PNR_setuid32 }, { "setxattr", 209 }, { "sgetmask", 68 }, - { "shmat", __PNR_shmat }, - { "shmctl", __PNR_shmctl }, - { "shmdt", __PNR_shmdt }, - { "shmget", __PNR_shmget }, + { "shmat", 397 }, + { "shmctl", 396 }, + { "shmdt", 398 }, + { "shmget", 395 }, { "shutdown", 338 }, { "sigaction", 67 }, { "sigaltstack", 185 }, @@ -428,11 +452,15 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "timer_delete", 244 }, { "timer_getoverrun", 243 }, { "timer_gettime", 242 }, + { "timer_gettime64", __PNR_timer_gettime64 }, { "timer_settime", 241 }, + { "timer_settime64", __PNR_timer_settime64 }, { "timerfd", __PNR_timerfd }, { "timerfd_create", 306 }, { "timerfd_gettime", 312 }, + { "timerfd_gettime64", __PNR_timerfd_gettime64 }, { "timerfd_settime", 311 }, + { "timerfd_settime64", __PNR_timerfd_settime64 }, { "times", 43 }, { "tkill", 208 }, { "truncate", 92 }, @@ -454,6 +482,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \ { "ustat", 62 }, { "utime", 30 }, { "utimensat", 304 }, + { "utimensat_time64", __PNR_utimensat_time64 }, { "utimes", 251 }, { "vfork", 189 }, { "vhangup", 111 }, diff --git a/src/arch-s390-syscalls.c b/src/arch-s390-syscalls.c index c2e3439..247bb46 100644 --- a/src/arch-s390-syscalls.c +++ b/src/arch-s390-syscalls.c @@ -10,7 +10,7 @@ #include "arch.h" #include "arch-s390.h" -/* NOTE: based on Linux 4.15-rc7 */ +/* NOTE: based on Linux v5.4-rc4 */ const struct arch_syscall_def s390_syscall_table[] = { \ { "_llseek", 140 }, { "_newselect", 142 }, @@ -42,11 +42,17 @@ const struct arch_syscall_def s390_syscall_table[] = { \ { "chown32", 212 }, { "chroot", 61 }, { "clock_adjtime", 337 }, + { "clock_adjtime64", 405 }, { "clock_getres", 261 }, + { "clock_getres_time64", 406 }, { "clock_gettime", 260 }, + { "clock_gettime64", 403 }, { "clock_nanosleep", 262 }, + { "clock_nanosleep_time64", 407 }, { "clock_settime", 259 }, + { "clock_settime64", 404 }, { "clone", 120 }, + { "clone3", 435 }, { "close", 6 }, { "connect", 362 }, { "copy_file_range", 375 }, @@ -90,7 +96,11 @@ const struct arch_syscall_def s390_syscall_table[] = { \ { "flock", 143 }, { "fork", 2 }, { "fremovexattr", 235 }, + { "fsconfig", 431 }, { "fsetxattr", 226 }, + { "fsmount", 432 }, + { "fsopen", 430 }, + { "fspick", 433 }, { "fstat", 108 }, { "fstat64", 197 }, { "fstatat64", 293 }, @@ -101,6 +111,7 @@ const struct arch_syscall_def s390_syscall_table[] = { \ { "ftruncate", 93 }, { "ftruncate64", 194 }, { "futex", 238 }, + { "futex_time64", 422 }, { "futimesat", 292 }, { "get_kernel_syms", 130 }, { "get_mempolicy", 269 }, @@ -153,6 +164,7 @@ const struct arch_syscall_def s390_syscall_table[] = { \ { "io_destroy", 244 }, { "io_getevents", 245 }, { "io_pgetevents", 382 }, + { "io_pgetevents_time64", 416 }, { "io_setup", 243 }, { "io_submit", 246 }, { "io_uring_setup", 425 }, @@ -201,6 +213,7 @@ const struct arch_syscall_def s390_syscall_table[] = { \ { "mmap2", 192 }, { "modify_ldt", __PNR_modify_ldt }, { "mount", 21 }, + { "move_mount", 429 }, { "move_pages", 310 }, { "mprotect", 125 }, { "mpx", __PNR_mpx }, @@ -208,13 +221,15 @@ const struct arch_syscall_def s390_syscall_table[] = { \ { "mq_notify", 275 }, { "mq_open", 271 }, { "mq_timedreceive", 274 }, + { "mq_timedreceive_time64", 419 }, { "mq_timedsend", 273 }, + { "mq_timedsend_time64", 418 }, { "mq_unlink", 272 }, { "mremap", 163 }, - { "msgctl", __PNR_msgctl }, - { "msgget", __PNR_msgget }, - { "msgrcv", __PNR_msgrcv }, - { "msgsnd", __PNR_msgsnd }, + { "msgctl", 402 }, + { "msgget", 399 }, + { "msgrcv", 401 }, + { "msgsnd", 400 }, { "msync", 144 }, { "multiplexer", __PNR_multiplexer }, { "munlock", 151 }, @@ -233,6 +248,7 @@ const struct arch_syscall_def s390_syscall_table[] = { \ { "oldwait4", __PNR_oldwait4 }, { "open", 5 }, { "open_by_handle_at", 336 }, + { "open_tree", 428 }, { "openat", 288 }, { "pause", 29 }, { "pciconfig_iobase", __PNR_pciconfig_iobase }, @@ -240,14 +256,17 @@ const struct arch_syscall_def s390_syscall_table[] = { \ { "pciconfig_write", __PNR_pciconfig_write }, { "perf_event_open", 331 }, { "personality", 136 }, + { "pidfd_open", 434 }, + { "pidfd_send_signal", 424 }, { "pipe", 42 }, { "pipe2", 325 }, { "pivot_root", 217 }, - { "pkey_alloc", __PNR_pkey_alloc }, - { "pkey_free", __PNR_pkey_free }, - { "pkey_mprotect", __PNR_pkey_mprotect }, + { "pkey_alloc", 385 }, + { "pkey_free", 386 }, + { "pkey_mprotect", 384 }, { "poll", 168 }, { "ppoll", 302 }, + { "ppoll_time64", 414 }, { "prctl", 172 }, { "pread64", 180 }, { "preadv", 328 }, @@ -258,6 +277,7 @@ const struct arch_syscall_def s390_syscall_table[] = { \ { "prof", __PNR_prof }, { "profil", __PNR_profil }, { "pselect6", 301 }, + { "pselect6_time64", 413 }, { "ptrace", 26 }, { "putpmsg", 189 }, { "pwrite64", 181 }, @@ -275,6 +295,7 @@ const struct arch_syscall_def s390_syscall_table[] = { \ { "recv", __PNR_recv }, { "recvfrom", 371 }, { "recvmmsg", 357 }, + { "recvmmsg_time64", 417 }, { "recvmsg", 372 }, { "remap_file_pages", 267 }, { "removexattr", 233 }, @@ -292,6 +313,7 @@ const struct arch_syscall_def s390_syscall_table[] = { \ { "rt_sigreturn", 173 }, { "rt_sigsuspend", 179 }, { "rt_sigtimedwait", 177 }, + { "rt_sigtimedwait_time64", 421 }, { "rt_tgsigqueueinfo", 330 }, { "rtas", __PNR_rtas }, { "s390_guarded_storage", 378 }, @@ -306,6 +328,7 @@ const struct arch_syscall_def s390_syscall_table[] = { \ { "sched_getparam", 155 }, { "sched_getscheduler", 157 }, { "sched_rr_get_interval", 161 }, + { "sched_rr_get_interval_time64", 423 }, { "sched_setaffinity", 239 }, { "sched_setattr", 345 }, { "sched_setparam", 154 }, @@ -314,10 +337,11 @@ const struct arch_syscall_def s390_syscall_table[] = { \ { "seccomp", 348 }, { "security", __PNR_security }, { "select", __PNR_select }, - { "semctl", __PNR_semctl }, - { "semget", __PNR_semget }, + { "semctl", 394 }, + { "semget", 393 }, { "semop", __PNR_semop }, { "semtimedop", __PNR_semtimedop }, + { "semtimedop_time64", 420 }, { "send", __PNR_send }, { "sendfile", 187 }, { "sendfile64", 223 }, @@ -359,10 +383,10 @@ const struct arch_syscall_def s390_syscall_table[] = { \ { "setuid32", 213 }, { "setxattr", 224 }, { "sgetmask", __PNR_sgetmask }, - { "shmat", __PNR_shmat }, - { "shmctl", __PNR_shmctl }, - { "shmdt", __PNR_shmdt }, - { "shmget", __PNR_shmget }, + { "shmat", 397 }, + { "shmctl", 396 }, + { "shmdt", 398 }, + { "shmget", 395 }, { "shutdown", 373 }, { "sigaction", 67 }, { "sigaltstack", 186 }, @@ -411,11 +435,15 @@ const struct arch_syscall_def s390_syscall_table[] = { \ { "timer_delete", 258 }, { "timer_getoverrun", 257 }, { "timer_gettime", 256 }, + { "timer_gettime64", 408 }, { "timer_settime", 255 }, + { "timer_settime64", 409 }, { "timerfd", 317 }, { "timerfd_create", 319 }, { "timerfd_gettime", 321 }, + { "timerfd_gettime64", 410 }, { "timerfd_settime", 320 }, + { "timerfd_settime64", 411 }, { "times", 43 }, { "tkill", 237 }, { "truncate", 92 }, @@ -437,6 +465,7 @@ const struct arch_syscall_def s390_syscall_table[] = { \ { "ustat", 62 }, { "utime", 30 }, { "utimensat", 315 }, + { "utimensat_time64", 412 }, { "utimes", 313 }, { "vfork", 190 }, { "vhangup", 111 }, diff --git a/src/arch-s390.c b/src/arch-s390.c index 2e49fb2..6c13368 100644 --- a/src/arch-s390.c +++ b/src/arch-s390.c @@ -27,16 +27,16 @@ const struct arch_def arch_def_s390 = { }; /** - * Convert a multiplexed pseudo socket syscall into a direct syscall - * @param socketcall the multiplexed pseudo syscall number + * Convert a multiplexed pseudo syscall into a direct syscall + * @param syscall the multiplexed pseudo syscall number * * Return the related direct syscall number, __NR_SCMP_UNDEF is there is * no related syscall, or __NR_SCMP_ERROR otherwise. * */ -static int _s390_sock_demux(int socketcall) +static int _s390_syscall_demux(int syscall) { - switch (socketcall) { + switch (syscall) { case -101: /* socket */ return 359; @@ -97,6 +97,43 @@ static int _s390_sock_demux(int socketcall) case -120: /* sendmmsg */ return 345; + case -201: + /* semop - not defined */ + return __NR_SCMP_UNDEF; + case -202: + /* semget */ + return 393; + case -203: + /* semctl */ + return 394; + case -204: + /* semtimedop - not defined */ + return __NR_SCMP_UNDEF; + case -211: + /* msgsnd */ + return 400; + case -212: + /* msgrcv */ + return 401; + case -213: + /* msgget */ + return 399; + case -214: + /* msgctl */ + return 402; + case -221: + /* shmat */ + return 397; + case -222: + /* shmdt */ + return 398; + case -223: + /* shmget */ + return 395; + case -224: + /* shmctl */ + return 396; + } return __NR_SCMP_ERROR; @@ -110,7 +147,7 @@ static int _s390_sock_demux(int socketcall) * there is no related pseudo syscall, or __NR_SCMP_ERROR otherwise. * */ -static int _s390_sock_mux(int syscall) +static int _s390_syscall_mux(int syscall) { switch (syscall) { case 337: @@ -164,6 +201,36 @@ static int _s390_sock_mux(int syscall) case 373: /* shutdown */ return -113; + case 393: + /* semget */ + return -202; + case 394: + /* semctl */ + return -203; + case 400: + /* msgsnd */ + return -211; + case 401: + /* msgrcv */ + return -212; + case 399: + /* msgget */ + return -213; + case 402: + /* msgctl */ + return -214; + case 397: + /* shmat */ + return -221; + case 398: + /* shmdt */ + return -222; + case 395: + /* shmget */ + return -223; + case 396: + /* shmctl */ + return -224; } return __NR_SCMP_ERROR; @@ -228,7 +295,7 @@ int s390_rule_add(struct db_filter *db, struct db_api_rule_list *rule) /* determine both the muxed and direct syscall numbers */ if (sys > 0) { - sys_a = _s390_sock_mux(sys); + sys_a = _s390_syscall_mux(sys); if (sys_a == __NR_SCMP_ERROR) { rc = __NR_SCMP_ERROR; goto add_return; @@ -236,7 +303,7 @@ int s390_rule_add(struct db_filter *db, struct db_api_rule_list *rule) sys_b = sys; } else { sys_a = sys; - sys_b = _s390_sock_demux(sys); + sys_b = _s390_syscall_demux(sys); if (sys_b == __NR_SCMP_ERROR) { rc = __NR_SCMP_ERROR; goto add_return; @@ -291,24 +358,81 @@ int s390_rule_add(struct db_filter *db, struct db_api_rule_list *rule) if (rc < 0) goto add_return; } - } else if (sys <= -200 && sys >= -224) { - /* multiplexed ipc syscalls */ + } else if ((sys <= -200 && sys >= -224) || (sys >= 393 && sys <= 402)) { + /* (-200 to -224) : multiplexed ipc syscalls + (393 to 402) : direct ipc syscalls */ + + /* strict check for the multiplexed socket syscalls */ for (iter = 0; iter < ARG_COUNT_MAX; iter++) { if ((rule->args[iter].valid != 0) && (rule->strict)) { rc = -EINVAL; goto add_return; } } - rule->args[0].arg = 0; - rule->args[0].op = SCMP_CMP_EQ; - rule->args[0].mask = DATUM_MAX; - rule->args[0].datum = abs(sys) % 200; - rule->args[0].valid = 1; - rule->syscall = __s390_NR_ipc; - rc = db_rule_add(db, rule); - if (rc < 0) - goto add_return; + /* determine both the muxed and direct syscall numbers */ + if (sys > 0) { + sys_a = _s390_syscall_mux(sys); + if (sys_a == __NR_SCMP_ERROR) { + rc = __NR_SCMP_ERROR; + goto add_return; + } + sys_b = sys; + } else { + sys_a = sys; + sys_b = _s390_syscall_demux(sys); + if (sys_b == __NR_SCMP_ERROR) { + rc = __NR_SCMP_ERROR; + goto add_return; + } + } + + /* use rule_a for the multiplexed syscall and use rule_b for + * the direct wired syscall */ + + if (sys_a == __NR_SCMP_UNDEF) { + rule_a = NULL; + rule_b = rule; + } else if (sys_b == __NR_SCMP_UNDEF) { + rule_a = rule; + rule_b = NULL; + } else { + /* need two rules, dup the first and link together */ + rule_a = rule; + rule_dup = db_rule_dup(rule_a); + rule_b = rule_dup; + if (rule_b == NULL) + goto add_return; + rule_b->prev = rule_a; + rule_b->next = NULL; + rule_a->next = rule_b; + } + + /* multiplexed socket syscalls */ + if (rule_a != NULL) { + rule_a->syscall = __s390_NR_ipc; + rule_a->args[0].arg = 0; + rule_a->args[0].op = SCMP_CMP_EQ; + rule_a->args[0].mask = DATUM_MAX; + rule_a->args[0].datum = (-sys_a) % 200; + rule_a->args[0].valid = 1; + } + + /* direct wired socket syscalls */ + if (rule_b != NULL) + rule_b->syscall = sys_b; + + /* we should be protected by a transaction checkpoint */ + if (rule_a != NULL) { + rc = db_rule_add(db, rule_a); + if (rc < 0) + goto add_return; + } + if (rule_b != NULL) { + rc = db_rule_add(db, rule_b); + if (rc < 0) + goto add_return; + } } else if (sys >= 0) { /* normal syscall processing */ rc = db_rule_add(db, rule); diff --git a/src/arch-s390x-syscalls.c b/src/arch-s390x-syscalls.c index e0a39f1..1ada38e 100644 --- a/src/arch-s390x-syscalls.c +++ b/src/arch-s390x-syscalls.c @@ -10,7 +10,7 @@ #include "arch.h" #include "arch-s390x.h" -/* NOTE: based on Linux 4.15-rc7 */ +/* NOTE: based on Linux v5.4-rc4 */ const struct arch_syscall_def s390x_syscall_table[] = { \ { "_llseek", __PNR__llseek }, { "_newselect", __PNR__newselect }, @@ -42,11 +42,17 @@ const struct arch_syscall_def s390x_syscall_table[] = { \ { "chown32", __PNR_chown32 }, { "chroot", 61 }, { "clock_adjtime", 337 }, + { "clock_adjtime64", __PNR_clock_adjtime64 }, { "clock_getres", 261 }, + { "clock_getres_time64", __PNR_clock_getres_time64 }, { "clock_gettime", 260 }, + { "clock_gettime64", __PNR_clock_gettime64 }, { "clock_nanosleep", 262 }, + { "clock_nanosleep_time64", __PNR_clock_nanosleep_time64 }, { "clock_settime", 259 }, + { "clock_settime64", __PNR_clock_settime64 }, { "clone", 120 }, + { "clone3", 435 }, { "close", 6 }, { "connect", 362 }, { "copy_file_range", 375 }, @@ -90,7 +96,11 @@ const struct arch_syscall_def s390x_syscall_table[] = { \ { "flock", 143 }, { "fork", 2 }, { "fremovexattr", 235 }, + { "fsconfig", 431 }, { "fsetxattr", 226 }, + { "fsmount", 432 }, + { "fsopen", 430 }, + { "fspick", 433 }, { "fstat", 108 }, { "fstat64", __PNR_fstat64 }, { "fstatat64", __PNR_fstatat64 }, @@ -101,6 +111,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \ { "ftruncate", 93 }, { "ftruncate64", __PNR_ftruncate64 }, { "futex", 238 }, + { "futex_time64", __PNR_futex_time64 }, { "futimesat", 292 }, { "get_kernel_syms", 130 }, { "get_mempolicy", 269 }, @@ -153,6 +164,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \ { "io_destroy", 244 }, { "io_getevents", 245 }, { "io_pgetevents", 382 }, + { "io_pgetevents_time64", __PNR_io_pgetevents_time64 }, { "io_setup", 243 }, { "io_submit", 246 }, { "io_uring_setup", 425 }, @@ -201,6 +213,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \ { "mmap2", __PNR_mmap2 }, { "modify_ldt", __PNR_modify_ldt }, { "mount", 21 }, + { "move_mount", 429 }, { "move_pages", 310 }, { "mprotect", 125 }, { "mpx", __PNR_mpx }, @@ -208,13 +221,15 @@ const struct arch_syscall_def s390x_syscall_table[] = { \ { "mq_notify", 275 }, { "mq_open", 271 }, { "mq_timedreceive", 274 }, + { "mq_timedreceive_time64", __PNR_mq_timedreceive_time64 }, { "mq_timedsend", 273 }, + { "mq_timedsend_time64", __PNR_mq_timedsend_time64 }, { "mq_unlink", 272 }, { "mremap", 163 }, - { "msgctl", __PNR_msgctl }, - { "msgget", __PNR_msgget }, - { "msgrcv", __PNR_msgrcv }, - { "msgsnd", __PNR_msgsnd }, + { "msgctl", 402 }, + { "msgget", 399 }, + { "msgrcv", 401 }, + { "msgsnd", 400 }, { "msync", 144 }, { "multiplexer", __PNR_multiplexer }, { "munlock", 151 }, @@ -233,6 +248,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \ { "oldwait4", __PNR_oldwait4 }, { "open", 5 }, { "open_by_handle_at", 336 }, + { "open_tree", 428 }, { "openat", 288 }, { "pause", 29 }, { "pciconfig_iobase", __PNR_pciconfig_iobase }, @@ -240,14 +256,17 @@ const struct arch_syscall_def s390x_syscall_table[] = { \ { "pciconfig_write", __PNR_pciconfig_write }, { "perf_event_open", 331 }, { "personality", 136 }, + { "pidfd_open", 434 }, + { "pidfd_send_signal", 424 }, { "pipe", 42 }, { "pipe2", 325 }, { "pivot_root", 217 }, - { "pkey_alloc", __PNR_pkey_alloc }, - { "pkey_free", __PNR_pkey_free }, - { "pkey_mprotect", __PNR_pkey_mprotect }, + { "pkey_alloc", 385 }, + { "pkey_free", 386 }, + { "pkey_mprotect", 384 }, { "poll", 168 }, { "ppoll", 302 }, + { "ppoll_time64", __PNR_ppoll_time64 }, { "prctl", 172 }, { "pread64", 180 }, { "preadv", 328 }, @@ -258,6 +277,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \ { "prof", __PNR_prof }, { "profil", __PNR_profil }, { "pselect6", 301 }, + { "pselect6_time64", __PNR_pselect6_time64 }, { "ptrace", 26 }, { "putpmsg", 189 }, { "pwrite64", 181 }, @@ -275,6 +295,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \ { "recv", __PNR_recv }, { "recvfrom", 371 }, { "recvmmsg", 357 }, + { "recvmmsg_time64", __PNR_recvmmsg_time64 }, { "recvmsg", 372 }, { "remap_file_pages", 267 }, { "removexattr", 233 }, @@ -292,6 +313,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \ { "rt_sigreturn", 173 }, { "rt_sigsuspend", 179 }, { "rt_sigtimedwait", 177 }, + { "rt_sigtimedwait_time64", __PNR_rt_sigtimedwait_time64 }, { "rt_tgsigqueueinfo", 330 }, { "rtas", __PNR_rtas }, { "s390_guarded_storage", 378 }, @@ -306,6 +328,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \ { "sched_getparam", 155 }, { "sched_getscheduler", 157 }, { "sched_rr_get_interval", 161 }, + { "sched_rr_get_interval_time64", __PNR_sched_rr_get_interval_time64 }, { "sched_setaffinity", 239 }, { "sched_setattr", 345 }, { "sched_setparam", 154 }, @@ -314,10 +337,11 @@ const struct arch_syscall_def s390x_syscall_table[] = { \ { "seccomp", 348 }, { "security", __PNR_security }, { "select", 142 }, - { "semctl", __PNR_semctl }, - { "semget", __PNR_semget }, + { "semctl", 394 }, + { "semget", 393 }, { "semop", __PNR_semop }, - { "semtimedop", __PNR_semtimedop }, + { "semtimedop", 392 }, + { "semtimedop_time64", __PNR_semtimedop_time64 }, { "send", __PNR_send }, { "sendfile", 187 }, { "sendfile64", __PNR_sendfile64 }, @@ -359,10 +383,10 @@ const struct arch_syscall_def s390x_syscall_table[] = { \ { "setuid32", __PNR_setuid32 }, { "setxattr", 224 }, { "sgetmask", __PNR_sgetmask }, - { "shmat", __PNR_shmat }, - { "shmctl", __PNR_shmctl }, - { "shmdt", __PNR_shmdt }, - { "shmget", __PNR_shmget }, + { "shmat", 397 }, + { "shmctl", 396 }, + { "shmdt", 398 }, + { "shmget", 395 }, { "shutdown", 373 }, { "sigaction", 67 }, { "sigaltstack", 186 }, @@ -411,11 +435,15 @@ const struct arch_syscall_def s390x_syscall_table[] = { \ { "timer_delete", 258 }, { "timer_getoverrun", 257 }, { "timer_gettime", 256 }, + { "timer_gettime64", __PNR_timer_gettime64 }, { "timer_settime", 255 }, + { "timer_settime64", __PNR_timer_settime64 }, { "timerfd", 317 }, { "timerfd_create", 319 }, { "timerfd_gettime", 321 }, + { "timerfd_gettime64", __PNR_timerfd_gettime64 }, { "timerfd_settime", 320 }, + { "timerfd_settime64", __PNR_timerfd_settime64 }, { "times", 43 }, { "tkill", 237 }, { "truncate", 92 }, @@ -437,6 +465,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \ { "ustat", 62 }, { "utime", 30 }, { "utimensat", 315 }, + { "utimensat_time64", __PNR_utimensat_time64 }, { "utimes", 313 }, { "vfork", 190 }, { "vhangup", 111 }, diff --git a/src/arch-s390x.c b/src/arch-s390x.c index acc6258..8815e6a 100644 --- a/src/arch-s390x.c +++ b/src/arch-s390x.c @@ -28,15 +28,15 @@ const struct arch_def arch_def_s390x = { /** * Convert a multiplexed pseudo socket syscall into a direct syscall - * @param socketcall the multiplexed pseudo syscall number + * @param syscall the multiplexed pseudo syscall number * * Return the related direct syscall number, __NR_SCMP_UNDEF is there is * no related syscall, or __NR_SCMP_ERROR otherwise. * */ -static int _s390x_sock_demux(int socketcall) +static int _s390x_syscall_demux(int syscall) { - switch (socketcall) { + switch (syscall) { case -101: /* socket */ return 359; @@ -97,6 +97,42 @@ static int _s390x_sock_demux(int socketcall) case -120: /* sendmmsg */ return 345; + case -201: + /* semop - not defined */ + return __NR_SCMP_UNDEF; + case -202: + /* semget */ + return 393; + case -203: + /* semctl */ + return 394; + case -204: + /* semtimedop */ + return 392; + case -211: + /* msgsnd */ + return 400; + case -212: + /* msgrcv */ + return 401; + case -213: + /* msgget */ + return 399; + case -214: + /* msgctl */ + return 402; + case -221: + /* shmat */ + return 397; + case -222: + /* shmdt */ + return 398; + case -223: + /* shmget */ + return 395; + case -224: + /* shmctl */ + return 396; } return __NR_SCMP_ERROR; @@ -110,7 +146,7 @@ static int _s390x_sock_demux(int socketcall) * there is no related pseudo syscall, or __NR_SCMP_ERROR otherwise. * */ -static int _s390x_sock_mux(int syscall) +static int _s390x_syscall_mux(int syscall) { switch (syscall) { case 337: @@ -164,6 +200,39 @@ static int _s390x_sock_mux(int syscall) case 373: /* shutdown */ return -113; + case 392: + /* semtimedop */ + return -204; + case 393: + /* semget */ + return -202; + case 394: + /* semctl */ + return -203; + case 400: + /* msgsnd */ + return -211; + case 401: + /* msgrcv */ + return -212; + case 399: + /* msgget */ + return -213; + case 402: + /* msgctl */ + return -214; + case 397: + /* shmat */ + return -221; + case 398: + /* shmdt */ + return -222; + case 395: + /* shmget */ + return -223; + case 396: + /* shmctl */ + return -224; } return __NR_SCMP_ERROR; @@ -228,7 +297,7 @@ int s390x_rule_add(struct db_filter *db, struct db_api_rule_list *rule) /* determine both the muxed and direct syscall numbers */ if (sys > 0) { - sys_a = _s390x_sock_mux(sys); + sys_a = _s390x_syscall_mux(sys); if (sys_a == __NR_SCMP_ERROR) { rc = __NR_SCMP_ERROR; goto add_return; @@ -236,7 +305,7 @@ int s390x_rule_add(struct db_filter *db, struct db_api_rule_list *rule) sys_b = sys; } else { sys_a = sys; - sys_b = _s390x_sock_demux(sys); + sys_b = _s390x_syscall_demux(sys); if (sys_b == __NR_SCMP_ERROR) { rc = __NR_SCMP_ERROR; goto add_return; @@ -291,24 +360,81 @@ int s390x_rule_add(struct db_filter *db, struct db_api_rule_list *rule) if (rc < 0) goto add_return; } - } else if (sys <= -200 && sys >= -224) { - /* multiplexed ipc syscalls */ + } else if ((sys <= -200 && sys >= -224) || (sys >= 392 && sys <= 402)) { + /* (-200 to -224) : multiplexed ipc syscalls + (392 to 402) : direct ipc syscalls */ + + /* strict check for the multiplexed socket syscalls */ for (iter = 0; iter < ARG_COUNT_MAX; iter++) { if ((rule->args[iter].valid != 0) && (rule->strict)) { rc = -EINVAL; goto add_return; } } - rule->args[0].arg = 0; - rule->args[0].op = SCMP_CMP_EQ; - rule->args[0].mask = DATUM_MAX; - rule->args[0].datum = abs(sys) % 200; - rule->args[0].valid = 1; - rule->syscall = __s390x_NR_ipc; - rc = db_rule_add(db, rule); - if (rc < 0) - goto add_return; + /* determine both the muxed and direct syscall numbers */ + if (sys > 0) { + sys_a = _s390x_syscall_mux(sys); + if (sys_a == __NR_SCMP_ERROR) { + rc = __NR_SCMP_ERROR; + goto add_return; + } + sys_b = sys; + } else { + sys_a = sys; + sys_b = _s390x_syscall_demux(sys); + if (sys_b == __NR_SCMP_ERROR) { + rc = __NR_SCMP_ERROR; + goto add_return; + } + } + + /* use rule_a for the multiplexed syscall and use rule_b for + * the direct wired syscall */ + + if (sys_a == __NR_SCMP_UNDEF) { + rule_a = NULL; + rule_b = rule; + } else if (sys_b == __NR_SCMP_UNDEF) { + rule_a = rule; + rule_b = NULL; + } else { + /* need two rules, dup the first and link together */ + rule_a = rule; + rule_dup = db_rule_dup(rule_a); + rule_b = rule_dup; + if (rule_b == NULL) + goto add_return; + rule_b->prev = rule_a; + rule_b->next = NULL; + rule_a->next = rule_b; + } + + /* multiplexed socket syscalls */ + if (rule_a != NULL) { + rule_a->syscall = __s390x_NR_ipc; + rule_a->args[0].arg = 0; + rule_a->args[0].op = SCMP_CMP_EQ; + rule_a->args[0].mask = DATUM_MAX; + rule_a->args[0].datum = (-sys_a) % 200; + rule_a->args[0].valid = 1; + } + + /* direct wired socket syscalls */ + if (rule_b != NULL) + rule_b->syscall = sys_b; + + /* we should be protected by a transaction checkpoint */ + if (rule_a != NULL) { + rc = db_rule_add(db, rule_a); + if (rc < 0) + goto add_return; + } + if (rule_b != NULL) { + rc = db_rule_add(db, rule_b); + if (rc < 0) + goto add_return; + } } else if (sys >= 0) { /* normal syscall processing */ rc = db_rule_add(db, rule); diff --git a/src/arch-x32-syscalls.c b/src/arch-x32-syscalls.c index f6b941b..e5cfadb 100644 --- a/src/arch-x32-syscalls.c +++ b/src/arch-x32-syscalls.c @@ -26,7 +26,7 @@ #include "arch.h" #include "arch-x32.h" -/* NOTE: based on Linux 4.15-rc7 */ +/* NOTE: based on Linux v5.4-rc4 */ const struct arch_syscall_def x32_syscall_table[] = { \ { "_llseek", __PNR__llseek }, { "_newselect", __PNR__newselect }, @@ -58,11 +58,17 @@ const struct arch_syscall_def x32_syscall_table[] = { \ { "chown32", __PNR_chown32 }, { "chroot", (X32_SYSCALL_BIT + 161) }, { "clock_adjtime", (X32_SYSCALL_BIT + 305) }, + { "clock_adjtime64", __PNR_clock_adjtime64 }, { "clock_getres", (X32_SYSCALL_BIT + 229) }, + { "clock_getres_time64", __PNR_clock_getres_time64 }, { "clock_gettime", (X32_SYSCALL_BIT + 228) }, + { "clock_gettime64", __PNR_clock_gettime64 }, { "clock_nanosleep", (X32_SYSCALL_BIT + 230) }, + { "clock_nanosleep_time64", __PNR_clock_nanosleep_time64 }, { "clock_settime", (X32_SYSCALL_BIT + 227) }, + { "clock_settime64", __PNR_clock_settime64 }, { "clone", (X32_SYSCALL_BIT + 56) }, + { "clone3", (X32_SYSCALL_BIT + 435) }, { "close", (X32_SYSCALL_BIT + 3) }, { "connect", (X32_SYSCALL_BIT + 42) }, { "copy_file_range", (X32_SYSCALL_BIT + 326) }, @@ -106,7 +112,11 @@ const struct arch_syscall_def x32_syscall_table[] = { \ { "flock", (X32_SYSCALL_BIT + 73) }, { "fork", (X32_SYSCALL_BIT + 57) }, { "fremovexattr", (X32_SYSCALL_BIT + 199) }, + { "fsconfig", (X32_SYSCALL_BIT + 431) }, { "fsetxattr", (X32_SYSCALL_BIT + 190) }, + { "fsmount", (X32_SYSCALL_BIT + 432) }, + { "fsopen", (X32_SYSCALL_BIT + 430) }, + { "fspick", (X32_SYSCALL_BIT + 433) }, { "fstat", (X32_SYSCALL_BIT + 5) }, { "fstat64", __PNR_fstat64 }, { "fstatat64", __PNR_fstatat64 }, @@ -117,6 +127,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \ { "ftruncate", (X32_SYSCALL_BIT + 77) }, { "ftruncate64", __PNR_ftruncate64 }, { "futex", (X32_SYSCALL_BIT + 202) }, + { "futex_time64", __PNR_futex_time64 }, { "futimesat", (X32_SYSCALL_BIT + 261) }, { "get_kernel_syms", __PNR_get_kernel_syms }, { "get_mempolicy", (X32_SYSCALL_BIT + 239) }, @@ -169,6 +180,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \ { "io_destroy", (X32_SYSCALL_BIT + 207) }, { "io_getevents", (X32_SYSCALL_BIT + 208) }, { "io_pgetevents", (X32_SYSCALL_BIT + 333) }, + { "io_pgetevents_time64", __PNR_io_pgetevents_time64 }, { "io_setup", (X32_SYSCALL_BIT + 543) }, { "io_submit", (X32_SYSCALL_BIT + 544) }, { "io_uring_setup", (X32_SYSCALL_BIT + 425) }, @@ -217,6 +229,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \ { "mmap2", __PNR_mmap2 }, { "modify_ldt", (X32_SYSCALL_BIT + 154) }, { "mount", (X32_SYSCALL_BIT + 165) }, + { "move_mount", (X32_SYSCALL_BIT + 429) }, { "move_pages", (X32_SYSCALL_BIT + 533) }, { "mprotect", (X32_SYSCALL_BIT + 10) }, { "mpx", __PNR_mpx }, @@ -224,7 +237,9 @@ const struct arch_syscall_def x32_syscall_table[] = { \ { "mq_notify", (X32_SYSCALL_BIT + 527) }, { "mq_open", (X32_SYSCALL_BIT + 240) }, { "mq_timedreceive", (X32_SYSCALL_BIT + 243) }, + { "mq_timedreceive_time64", __PNR_mq_timedreceive_time64 }, { "mq_timedsend", (X32_SYSCALL_BIT + 242) }, + { "mq_timedsend_time64", __PNR_mq_timedsend_time64 }, { "mq_unlink", (X32_SYSCALL_BIT + 241) }, { "mremap", (X32_SYSCALL_BIT + 25) }, { "msgctl", (X32_SYSCALL_BIT + 71) }, @@ -249,6 +264,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \ { "oldwait4", __PNR_oldwait4 }, { "open", (X32_SYSCALL_BIT + 2) }, { "open_by_handle_at", (X32_SYSCALL_BIT + 304) }, + { "open_tree", (X32_SYSCALL_BIT + 428) }, { "openat", (X32_SYSCALL_BIT + 257) }, { "pause", (X32_SYSCALL_BIT + 34) }, { "pciconfig_iobase", __PNR_pciconfig_iobase }, @@ -256,6 +272,8 @@ const struct arch_syscall_def x32_syscall_table[] = { \ { "pciconfig_write", __PNR_pciconfig_write }, { "perf_event_open", (X32_SYSCALL_BIT + 298) }, { "personality", (X32_SYSCALL_BIT + 135) }, + { "pidfd_open", (X32_SYSCALL_BIT + 434) }, + { "pidfd_send_signal", (X32_SYSCALL_BIT + 424) }, { "pipe", (X32_SYSCALL_BIT + 22) }, { "pipe2", (X32_SYSCALL_BIT + 293) }, { "pivot_root", (X32_SYSCALL_BIT + 155) }, @@ -264,6 +282,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \ { "pkey_mprotect", (X32_SYSCALL_BIT + 329) }, { "poll", (X32_SYSCALL_BIT + 7) }, { "ppoll", (X32_SYSCALL_BIT + 271) }, + { "ppoll_time64", __PNR_ppoll_time64 }, { "prctl", (X32_SYSCALL_BIT + 157) }, { "pread64", (X32_SYSCALL_BIT + 17) }, { "preadv", (X32_SYSCALL_BIT + 534) }, @@ -274,6 +293,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \ { "prof", __PNR_prof }, { "profil", __PNR_profil }, { "pselect6", (X32_SYSCALL_BIT + 270) }, + { "pselect6_time64", __PNR_pselect6_time64 }, { "ptrace", (X32_SYSCALL_BIT + 521) }, { "putpmsg", (X32_SYSCALL_BIT + 182) }, { "pwrite64", (X32_SYSCALL_BIT + 18) }, @@ -291,6 +311,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \ { "recv", __PNR_recv }, { "recvfrom", (X32_SYSCALL_BIT + 517) }, { "recvmmsg", (X32_SYSCALL_BIT + 537) }, + { "recvmmsg_time64", __PNR_recvmmsg_time64 }, { "recvmsg", (X32_SYSCALL_BIT + 519) }, { "remap_file_pages", (X32_SYSCALL_BIT + 216) }, { "removexattr", (X32_SYSCALL_BIT + 197) }, @@ -308,6 +329,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \ { "rt_sigreturn", (X32_SYSCALL_BIT + 513) }, { "rt_sigsuspend", (X32_SYSCALL_BIT + 130) }, { "rt_sigtimedwait", (X32_SYSCALL_BIT + 523) }, + { "rt_sigtimedwait_time64", __PNR_rt_sigtimedwait_time64 }, { "rt_tgsigqueueinfo", (X32_SYSCALL_BIT + 536) }, { "rtas", __PNR_rtas }, { "s390_guarded_storage", __PNR_s390_guarded_storage }, @@ -322,6 +344,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \ { "sched_getparam", (X32_SYSCALL_BIT + 143) }, { "sched_getscheduler", (X32_SYSCALL_BIT + 145) }, { "sched_rr_get_interval", (X32_SYSCALL_BIT + 148) }, + { "sched_rr_get_interval_time64", __PNR_sched_rr_get_interval_time64 }, { "sched_setaffinity", (X32_SYSCALL_BIT + 203) }, { "sched_setattr", (X32_SYSCALL_BIT + 314) }, { "sched_setparam", (X32_SYSCALL_BIT + 142) }, @@ -334,6 +357,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \ { "semget", (X32_SYSCALL_BIT + 64) }, { "semop", (X32_SYSCALL_BIT + 65) }, { "semtimedop", (X32_SYSCALL_BIT + 220) }, + { "semtimedop_time64", __PNR_semtimedop_time64 }, { "send", __PNR_send }, { "sendfile", (X32_SYSCALL_BIT + 40) }, { "sendfile64", __PNR_sendfile64 }, @@ -427,11 +451,15 @@ const struct arch_syscall_def x32_syscall_table[] = { \ { "timer_delete", (X32_SYSCALL_BIT + 226) }, { "timer_getoverrun", (X32_SYSCALL_BIT + 225) }, { "timer_gettime", (X32_SYSCALL_BIT + 224) }, + { "timer_gettime64", __PNR_timer_gettime64 }, { "timer_settime", (X32_SYSCALL_BIT + 223) }, + { "timer_settime64", __PNR_timer_settime64 }, { "timerfd", __PNR_timerfd }, { "timerfd_create", (X32_SYSCALL_BIT + 283) }, { "timerfd_gettime", (X32_SYSCALL_BIT + 287) }, + { "timerfd_gettime64", __PNR_timerfd_gettime64 }, { "timerfd_settime", (X32_SYSCALL_BIT + 286) }, + { "timerfd_settime64", __PNR_timerfd_settime64 }, { "times", (X32_SYSCALL_BIT + 100) }, { "tkill", (X32_SYSCALL_BIT + 200) }, { "truncate", (X32_SYSCALL_BIT + 76) }, @@ -453,6 +481,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \ { "ustat", (X32_SYSCALL_BIT + 136) }, { "utime", (X32_SYSCALL_BIT + 132) }, { "utimensat", (X32_SYSCALL_BIT + 280) }, + { "utimensat_time64", __PNR_utimensat_time64 }, { "utimes", (X32_SYSCALL_BIT + 235) }, { "vfork", (X32_SYSCALL_BIT + 58) }, { "vhangup", (X32_SYSCALL_BIT + 153) }, diff --git a/src/arch-x86-syscalls.c b/src/arch-x86-syscalls.c index 5bd0ca2..ffaac7f 100644 --- a/src/arch-x86-syscalls.c +++ b/src/arch-x86-syscalls.c @@ -26,7 +26,7 @@ #include "arch.h" #include "arch-x86.h" -/* NOTE: based on Linux 4.15-rc7 */ +/* NOTE: based on Linux v5.4-rc4 */ const struct arch_syscall_def x86_syscall_table[] = { \ { "_llseek", 140 }, { "_newselect", 142 }, @@ -58,11 +58,17 @@ const struct arch_syscall_def x86_syscall_table[] = { \ { "chown32", 212 }, { "chroot", 61 }, { "clock_adjtime", 343 }, + { "clock_adjtime64", 405 }, { "clock_getres", 266 }, + { "clock_getres_time64", 406 }, { "clock_gettime", 265 }, + { "clock_gettime64", 403 }, { "clock_nanosleep", 267 }, + { "clock_nanosleep_time64", 407 }, { "clock_settime", 264 }, + { "clock_settime64", 404 }, { "clone", 120 }, + { "clone3", 435 }, { "close", 6 }, { "connect", 362 }, { "copy_file_range", 377 }, @@ -106,7 +112,11 @@ const struct arch_syscall_def x86_syscall_table[] = { \ { "flock", 143 }, { "fork", 2 }, { "fremovexattr", 237 }, + { "fsconfig", 431 }, { "fsetxattr", 228 }, + { "fsmount", 432 }, + { "fsopen", 430 }, + { "fspick", 433 }, { "fstat", 108 }, { "fstat64", 197 }, { "fstatat64", 300 }, @@ -117,6 +127,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \ { "ftruncate", 93 }, { "ftruncate64", 194 }, { "futex", 240 }, + { "futex_time64", 422 }, { "futimesat", 299 }, { "get_kernel_syms", 130 }, { "get_mempolicy", 275 }, @@ -169,6 +180,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \ { "io_destroy", 246 }, { "io_getevents", 247 }, { "io_pgetevents", 385 }, + { "io_pgetevents_time64", 416 }, { "io_setup", 245 }, { "io_submit", 248 }, { "io_uring_setup", 425 }, @@ -217,6 +229,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \ { "mmap2", 192 }, { "modify_ldt", 123 }, { "mount", 21 }, + { "move_mount", 429 }, { "move_pages", 317 }, { "mprotect", 125 }, { "mpx", 56 }, @@ -224,13 +237,15 @@ const struct arch_syscall_def x86_syscall_table[] = { \ { "mq_notify", 281 }, { "mq_open", 277 }, { "mq_timedreceive", 280 }, + { "mq_timedreceive_time64", 419 }, { "mq_timedsend", 279 }, + { "mq_timedsend_time64", 418 }, { "mq_unlink", 278 }, { "mremap", 163 }, - { "msgctl", __PNR_msgctl }, - { "msgget", __PNR_msgget }, - { "msgrcv", __PNR_msgrcv }, - { "msgsnd", __PNR_msgsnd }, + { "msgctl", 402 }, + { "msgget", 399 }, + { "msgrcv", 401 }, + { "msgsnd", 400 }, { "msync", 144 }, { "multiplexer", __PNR_multiplexer }, { "munlock", 151 }, @@ -249,6 +264,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \ { "oldwait4", __PNR_oldwait4 }, { "open", 5 }, { "open_by_handle_at", 342 }, + { "open_tree", 428 }, { "openat", 295 }, { "pause", 29 }, { "pciconfig_iobase", __PNR_pciconfig_iobase }, @@ -256,6 +272,8 @@ const struct arch_syscall_def x86_syscall_table[] = { \ { "pciconfig_write", __PNR_pciconfig_write }, { "perf_event_open", 336 }, { "personality", 136 }, + { "pidfd_open", 434 }, + { "pidfd_send_signal", 424 }, { "pipe", 42 }, { "pipe2", 331 }, { "pivot_root", 217 }, @@ -264,6 +282,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \ { "pkey_mprotect", 380 }, { "poll", 168 }, { "ppoll", 309 }, + { "ppoll_time64", 414 }, { "prctl", 172 }, { "pread64", 180 }, { "preadv", 333 }, @@ -274,6 +293,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \ { "prof", 44 }, { "profil", 98 }, { "pselect6", 308 }, + { "pselect6_time64", 413 }, { "ptrace", 26 }, { "putpmsg", 189 }, { "pwrite64", 181 }, @@ -291,6 +311,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \ { "recv", __PNR_recv }, { "recvfrom", 371 }, { "recvmmsg", 337 }, + { "recvmmsg_time64", 417 }, { "recvmsg", 372 }, { "remap_file_pages", 257 }, { "removexattr", 235 }, @@ -308,6 +329,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \ { "rt_sigreturn", 173 }, { "rt_sigsuspend", 179 }, { "rt_sigtimedwait", 177 }, + { "rt_sigtimedwait_time64", 421 }, { "rt_tgsigqueueinfo", 335 }, { "rtas", __PNR_rtas }, { "s390_guarded_storage", __PNR_s390_guarded_storage }, @@ -322,6 +344,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \ { "sched_getparam", 155 }, { "sched_getscheduler", 157 }, { "sched_rr_get_interval", 161 }, + { "sched_rr_get_interval_time64", 423 }, { "sched_setaffinity", 241 }, { "sched_setattr", 351 }, { "sched_setparam", 154 }, @@ -330,10 +353,11 @@ const struct arch_syscall_def x86_syscall_table[] = { \ { "seccomp", 354 }, { "security", __PNR_security }, { "select", 82 }, - { "semctl", __PNR_semctl }, - { "semget", __PNR_semget }, + { "semctl", 394 }, + { "semget", 393 }, { "semop", __PNR_semop }, { "semtimedop", __PNR_semtimedop }, + { "semtimedop_time64", 420 }, { "send", __PNR_send }, { "sendfile", 187 }, { "sendfile64", 239 }, @@ -375,10 +399,10 @@ const struct arch_syscall_def x86_syscall_table[] = { \ { "setuid32", 213 }, { "setxattr", 226 }, { "sgetmask", 68 }, - { "shmat", __PNR_shmat }, - { "shmctl", __PNR_shmctl }, - { "shmdt", __PNR_shmdt }, - { "shmget", __PNR_shmget }, + { "shmat", 397 }, + { "shmctl", 396 }, + { "shmdt", 398 }, + { "shmget", 395 }, { "shutdown", 373 }, { "sigaction", 67 }, { "sigaltstack", 186 }, @@ -427,11 +451,15 @@ const struct arch_syscall_def x86_syscall_table[] = { \ { "timer_delete", 263 }, { "timer_getoverrun", 262 }, { "timer_gettime", 261 }, + { "timer_gettime64", 408 }, { "timer_settime", 260 }, + { "timer_settime64", 409 }, { "timerfd", __PNR_timerfd }, { "timerfd_create", 322 }, { "timerfd_gettime", 326 }, + { "timerfd_gettime64", 410 }, { "timerfd_settime", 325 }, + { "timerfd_settime64", 411 }, { "times", 43 }, { "tkill", 238 }, { "truncate", 92 }, @@ -453,6 +481,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \ { "ustat", 62 }, { "utime", 30 }, { "utimensat", 320 }, + { "utimensat_time64", 412 }, { "utimes", 271 }, { "vfork", 190 }, { "vhangup", 111 }, @@ -486,7 +515,7 @@ int x86_syscall_resolve_name(const char *name) if (strcmp(name, "accept") == 0) return __PNR_accept; - if (strcmp(name, "accept4") == 0) + else if (strcmp(name, "accept4") == 0) return __PNR_accept4; else if (strcmp(name, "bind") == 0) return __PNR_bind; @@ -525,6 +554,31 @@ int x86_syscall_resolve_name(const char *name) else if (strcmp(name, "socketpair") == 0) return __PNR_socketpair; + if (strcmp(name, "semop") == 0) + return __PNR_semop; + else if (strcmp(name, "semget") == 0) + return __PNR_semget; + else if (strcmp(name, "semctl") == 0) + return __PNR_semctl; + else if (strcmp(name, "semtimedop") == 0) + return __PNR_semtimedop; + else if (strcmp(name, "msgsnd") == 0) + return __PNR_msgsnd; + else if (strcmp(name, "msgrcv") == 0) + return __PNR_msgrcv; + else if (strcmp(name, "msgget") == 0) + return __PNR_msgget; + else if (strcmp(name, "msgctl") == 0) + return __PNR_msgctl; + else if (strcmp(name, "shmat") == 0) + return __PNR_shmat; + else if (strcmp(name, "shmdt") == 0) + return __PNR_shmdt; + else if (strcmp(name, "shmget") == 0) + return __PNR_shmget; + else if (strcmp(name, "shmctl") == 0) + return __PNR_shmctl; + for (iter = 0; table[iter].name != NULL; iter++) { if (strcmp(name, table[iter].name) == 0) return table[iter].num; @@ -590,6 +644,33 @@ const char *x86_syscall_resolve_num(int num) else if (num == __PNR_socketpair) return "socketpair"; + if (num == __PNR_semop) + return "semop"; + else if (num == __PNR_semget) + return "semget"; + else if (num == __PNR_semctl) + return "semctl"; + else if (num == __PNR_semtimedop) + return "semtimedop"; + else if (num == __PNR_msgsnd) + return "msgsnd"; + else if (num == __PNR_msgrcv) + return "msgrcv"; + else if (num == __PNR_msgget) + return "msgget"; + else if (num == __PNR_msgctl) + return "msgctl"; + else if (num == __PNR_shmat) + return "shmat"; + else if (num == __PNR_shmdt) + return "shmdt"; + else if (num == __PNR_shmdt) + return "shmget"; + else if (num == __PNR_shmget) + return "shmget"; + else if (num == __PNR_shmctl) + return "shmctl"; + for (iter = 0; table[iter].num != __NR_SCMP_ERROR; iter++) { if (num == table[iter].num) return table[iter].name; diff --git a/src/arch-x86.c b/src/arch-x86.c index 4126737..fc0deaa 100644 --- a/src/arch-x86.c +++ b/src/arch-x86.c @@ -43,16 +43,16 @@ const struct arch_def arch_def_x86 = { }; /** - * Convert a multiplexed pseudo socket syscall into a direct syscall - * @param socketcall the multiplexed pseudo syscall number + * Convert a multiplexed pseudo syscall into a direct syscall + * @param syscall the multiplexed pseudo syscall number * * Return the related direct syscall number, __NR_SCMP_UNDEF is there is * no related syscall, or __NR_SCMP_ERROR otherwise. * */ -static int _x86_sock_demux(int socketcall) +static int _x86_syscall_demux(int syscall) { - switch (socketcall) { + switch (syscall) { case -101: /* socket */ return 359; @@ -113,20 +113,56 @@ static int _x86_sock_demux(int socketcall) case -120: /* sendmmsg */ return 345; + case -201: + /* semop - not defined */ + return __NR_SCMP_UNDEF; + case -202: + /* semget */ + return 393; + case -203: + /* semctl */ + return 394; + case -204: + /* semtimedop - not defined */ + return __NR_SCMP_UNDEF; + case -211: + /* msgsnd */ + return 400; + case -212: + /* msgrcv */ + return 401; + case -213: + /* msgget */ + return 399; + case -214: + /* msgctl */ + return 402; + case -221: + /* shmat */ + return 397; + case -222: + /* shmdt */ + return 398; + case -223: + /* shmget */ + return 395; + case -224: + /* shmctl */ + return 396; } return __NR_SCMP_ERROR; } /** - * Convert a direct socket syscall into multiplexed pseudo socket syscall + * Convert a direct syscall into multiplexed pseudo socket syscall * @param syscall the direct syscall * * Return the related multiplexed pseduo syscall number, __NR_SCMP_UNDEF is * there is no related pseudo syscall, or __NR_SCMP_ERROR otherwise. * */ -static int _x86_sock_mux(int syscall) +static int _x86_syscall_mux(int syscall) { switch (syscall) { case 337: @@ -180,6 +216,36 @@ static int _x86_sock_mux(int syscall) case 373: /* shutdown */ return -113; + case 393: + /* semget */ + return -202; + case 394: + /* semctl */ + return -203; + case 400: + /* msgsnd */ + return -211; + case 401: + /* msgrcv */ + return -212; + case 399: + /* msgget */ + return -213; + case 402: + /* msgctl */ + return -214; + case 397: + /* shmat */ + return -221; + case 398: + /* shmdt */ + return -222; + case 395: + /* shmget */ + return -223; + case 396: + /* shmctl */ + return -224; } return __NR_SCMP_ERROR; @@ -244,7 +310,7 @@ int x86_rule_add(struct db_filter *db, struct db_api_rule_list *rule) /* determine both the muxed and direct syscall numbers */ if (sys > 0) { - sys_a = _x86_sock_mux(sys); + sys_a = _x86_syscall_mux(sys); if (sys_a == __NR_SCMP_ERROR) { rc = __NR_SCMP_ERROR; goto add_return; @@ -252,7 +318,7 @@ int x86_rule_add(struct db_filter *db, struct db_api_rule_list *rule) sys_b = sys; } else { sys_a = sys; - sys_b = _x86_sock_demux(sys); + sys_b = _x86_syscall_demux(sys); if (sys_b == __NR_SCMP_ERROR) { rc = __NR_SCMP_ERROR; goto add_return; @@ -305,24 +371,81 @@ int x86_rule_add(struct db_filter *db, struct db_api_rule_list *rule) if (rc < 0) goto add_return; } - } else if (sys <= -200 && sys >= -224) { - /* multiplexed ipc syscalls */ + } else if ((sys <= -200 && sys >= -224) || (sys >= 393 && sys <= 402)) { + /* (-200 to -224) : multiplexed ipc syscalls + (393 to 402) : direct ipc syscalls */ + + /* strict check for the multiplexed socket syscalls */ for (iter = 0; iter < ARG_COUNT_MAX; iter++) { if ((rule->args[iter].valid != 0) && (rule->strict)) { rc = -EINVAL; goto add_return; } } - rule->args[0].arg = 0; - rule->args[0].op = SCMP_CMP_EQ; - rule->args[0].mask = DATUM_MAX; - rule->args[0].datum = abs(sys) % 200; - rule->args[0].valid = 1; - rule->syscall = __x86_NR_ipc; - rc = db_rule_add(db, rule); - if (rc < 0) - goto add_return; + /* determine both the muxed and direct syscall numbers */ + if (sys > 0) { + sys_a = _x86_syscall_mux(sys); + if (sys_a == __NR_SCMP_ERROR) { + rc = __NR_SCMP_ERROR; + goto add_return; + } + sys_b = sys; + } else { + sys_a = sys; + sys_b = _x86_syscall_demux(sys); + if (sys_b == __NR_SCMP_ERROR) { + rc = __NR_SCMP_ERROR; + goto add_return; + } + } + + /* use rule_a for the multiplexed syscall and use rule_b for + * the direct wired syscall */ + + if (sys_a == __NR_SCMP_UNDEF) { + rule_a = NULL; + rule_b = rule; + } else if (sys_b == __NR_SCMP_UNDEF) { + rule_a = rule; + rule_b = NULL; + } else { + /* need two rules, dup the first and link together */ + rule_a = rule; + rule_dup = db_rule_dup(rule_a); + rule_b = rule_dup; + if (rule_b == NULL) + goto add_return; + rule_b->prev = rule_a; + rule_b->next = NULL; + rule_a->next = rule_b; + } + + /* multiplexed socket syscalls */ + if (rule_a != NULL) { + rule_a->syscall = __x86_NR_ipc; + rule_a->args[0].arg = 0; + rule_a->args[0].op = SCMP_CMP_EQ; + rule_a->args[0].mask = DATUM_MAX; + rule_a->args[0].datum = (-sys_a) % 200; + rule_a->args[0].valid = 1; + } + + /* direct wired socket syscalls */ + if (rule_b != NULL) + rule_b->syscall = sys_b; + + /* we should be protected by a transaction checkpoint */ + if (rule_a != NULL) { + rc = db_rule_add(db, rule_a); + if (rc < 0) + goto add_return; + } + if (rule_b != NULL) { + rc = db_rule_add(db, rule_b); + if (rc < 0) + goto add_return; + } } else if (sys >= 0) { /* normal syscall processing */ rc = db_rule_add(db, rule); diff --git a/src/arch-x86_64-syscalls.c b/src/arch-x86_64-syscalls.c index f7c8ce6..a2fdef8 100644 --- a/src/arch-x86_64-syscalls.c +++ b/src/arch-x86_64-syscalls.c @@ -26,7 +26,7 @@ #include "arch.h" #include "arch-x86_64.h" -/* NOTE: based on Linux 4.15-rc7 */ +/* NOTE: based on Linux v5.4-rc4 */ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "_llseek", __PNR__llseek }, { "_newselect", __PNR__newselect }, @@ -58,11 +58,17 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "chown32", __PNR_chown32 }, { "chroot", 161 }, { "clock_adjtime", 305 }, + { "clock_adjtime64", __PNR_clock_adjtime64 }, { "clock_getres", 229 }, + { "clock_getres_time64", __PNR_clock_getres_time64 }, { "clock_gettime", 228 }, + { "clock_gettime64", __PNR_clock_gettime64 }, { "clock_nanosleep", 230 }, + { "clock_nanosleep_time64", __PNR_clock_nanosleep_time64 }, { "clock_settime", 227 }, + { "clock_settime64", __PNR_clock_settime64 }, { "clone", 56 }, + { "clone3", 435 }, { "close", 3 }, { "connect", 42 }, { "copy_file_range", 326 }, @@ -106,7 +112,11 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "flock", 73 }, { "fork", 57 }, { "fremovexattr", 199 }, + { "fsconfig", 431 }, { "fsetxattr", 190 }, + { "fsmount", 432 }, + { "fsopen", 430 }, + { "fspick", 433 }, { "fstat", 5 }, { "fstat64", __PNR_fstat64 }, { "fstatat64", __PNR_fstatat64 }, @@ -117,6 +127,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "ftruncate", 77 }, { "ftruncate64", __PNR_ftruncate64 }, { "futex", 202 }, + { "futex_time64", __PNR_futex_time64 }, { "futimesat", 261 }, { "get_kernel_syms", 177 }, { "get_mempolicy", 239 }, @@ -169,6 +180,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "io_destroy", 207 }, { "io_getevents", 208 }, { "io_pgetevents", 333 }, + { "io_pgetevents_time64", __PNR_io_pgetevents_time64 }, { "io_setup", 206 }, { "io_submit", 209 }, { "io_uring_setup", 425 }, @@ -217,6 +229,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "mmap2", __PNR_mmap2 }, { "modify_ldt", 154 }, { "mount", 165 }, + { "move_mount", 429 }, { "move_pages", 279 }, { "mprotect", 10 }, { "mpx", __PNR_mpx }, @@ -224,7 +237,9 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "mq_notify", 244 }, { "mq_open", 240 }, { "mq_timedreceive", 243 }, + { "mq_timedreceive_time64", __PNR_mq_timedreceive_time64 }, { "mq_timedsend", 242 }, + { "mq_timedsend_time64", __PNR_mq_timedsend_time64 }, { "mq_unlink", 241 }, { "mremap", 25 }, { "msgctl", 71 }, @@ -249,6 +264,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "oldwait4", __PNR_oldwait4 }, { "open", 2 }, { "open_by_handle_at", 304 }, + { "open_tree", 428 }, { "openat", 257 }, { "pause", 34 }, { "pciconfig_iobase", __PNR_pciconfig_iobase }, @@ -256,6 +272,8 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "pciconfig_write", __PNR_pciconfig_write }, { "perf_event_open", 298 }, { "personality", 135 }, + { "pidfd_open", 434 }, + { "pidfd_send_signal", 424 }, { "pipe", 22 }, { "pipe2", 293 }, { "pivot_root", 155 }, @@ -264,6 +282,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "pkey_mprotect", 329 }, { "poll", 7 }, { "ppoll", 271 }, + { "ppoll_time64", __PNR_ppoll_time64 }, { "prctl", 157 }, { "pread64", 17 }, { "preadv", 295 }, @@ -274,6 +293,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "prof", __PNR_prof }, { "profil", __PNR_profil }, { "pselect6", 270 }, + { "pselect6_time64", __PNR_pselect6_time64 }, { "ptrace", 101 }, { "putpmsg", 182 }, { "pwrite64", 18 }, @@ -291,6 +311,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "recv", __PNR_recv }, { "recvfrom", 45 }, { "recvmmsg", 299 }, + { "recvmmsg_time64", __PNR_recvmmsg_time64 }, { "recvmsg", 47 }, { "remap_file_pages", 216 }, { "removexattr", 197 }, @@ -308,6 +329,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "rt_sigreturn", 15 }, { "rt_sigsuspend", 130 }, { "rt_sigtimedwait", 128 }, + { "rt_sigtimedwait_time64", __PNR_rt_sigtimedwait_time64 }, { "rt_tgsigqueueinfo", 297 }, { "rtas", __PNR_rtas }, { "s390_guarded_storage", __PNR_s390_guarded_storage }, @@ -322,6 +344,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "sched_getparam", 143 }, { "sched_getscheduler", 145 }, { "sched_rr_get_interval", 148 }, + { "sched_rr_get_interval_time64", __PNR_sched_rr_get_interval_time64 }, { "sched_setaffinity", 203 }, { "sched_setattr", 314 }, { "sched_setparam", 142 }, @@ -334,6 +357,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "semget", 64 }, { "semop", 65 }, { "semtimedop", 220 }, + { "semtimedop_time64", __PNR_semtimedop_time64 }, { "send", __PNR_send }, { "sendfile", 40 }, { "sendfile64", __PNR_sendfile64 }, @@ -427,11 +451,15 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "timer_delete", 226 }, { "timer_getoverrun", 225 }, { "timer_gettime", 224 }, + { "timer_gettime64", __PNR_timer_gettime64 }, { "timer_settime", 223 }, + { "timer_settime64", __PNR_timer_settime64 }, { "timerfd", __PNR_timerfd }, { "timerfd_create", 283 }, { "timerfd_gettime", 287 }, + { "timerfd_gettime64", __PNR_timerfd_gettime64 }, { "timerfd_settime", 286 }, + { "timerfd_settime64", __PNR_timerfd_settime64 }, { "times", 100 }, { "tkill", 200 }, { "truncate", 76 }, @@ -453,6 +481,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \ { "ustat", 136 }, { "utime", 132 }, { "utimensat", 280 }, + { "utimensat_time64", __PNR_utimensat_time64 }, { "utimes", 235 }, { "vfork", 58 }, { "vhangup", 153 }, -- cgit v1.2.1