libseccomp/libseccomp-2.5.2_e2k.patch
Ilfat Gaptrakhmanov 1effa00ef1
Add e2k patch
2022-03-14 21:33:59 +03:00

1080 lines
40 KiB
Diff

diff -Naur old/include/seccomp.h.in new/include/seccomp.h.in
--- old/include/seccomp.h.in 2021-09-01 20:01:27.000000000 +0300
+++ new/include/seccomp.h.in 2022-03-14 19:33:22.103158744 +0300
@@ -217,6 +217,11 @@
#define SCMP_ARCH_RISCV64 AUDIT_ARCH_RISCV64
/**
+ * The E2K architecture tokens
+ */
+#define SCMP_ARCH_E2K (AUDIT_ARCH_E2K | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
+
+/**
* Convert a syscall name into the associated syscall number
* @param x the syscall name
*/
diff -Naur old/include/seccomp-syscalls.h new/include/seccomp-syscalls.h
--- old/include/seccomp-syscalls.h 2021-09-01 20:01:27.000000000 +0300
+++ new/include/seccomp-syscalls.h 2022-03-14 19:28:14.197015181 +0300
@@ -1537,6 +1537,16 @@
#define __SNR_rseq __PNR_rseq
#endif
+#define __PNR_pread64 -20000
+#ifndef __NR_pread64
+#define __NR_pread64 __PNR_pread64
+#endif /* __NR_pread64 */
+
+#define __PNR_pwrite64 -20001
+#ifndef __NR_pwrite64
+#define __NR_pwrite64 __PNR_pwrite64
+#endif /* __NR_pwrite64 */
+
#define __SNR_rt_sigaction __NR_rt_sigaction
#define __SNR_rt_sigpending __NR_rt_sigpending
diff -Naur old/src/arch.c new/src/arch.c
--- old/src/arch.c 2021-09-01 20:01:27.000000000 +0300
+++ new/src/arch.c 2022-03-14 19:37:12.256183124 +0300
@@ -45,6 +45,7 @@
#include "arch-riscv64.h"
#include "arch-s390.h"
#include "arch-s390x.h"
+#include "arch-e2k.h"
#include "db.h"
#include "system.h"
@@ -96,6 +97,8 @@
const struct arch_def *arch_def_native = &arch_def_s390x;
#elif __s390__
const struct arch_def *arch_def_native = &arch_def_s390;
+#elif __e2k__
+const struct arch_def *arch_def_native = &arch_def_e2k;
#elif __riscv && __riscv_xlen == 64
const struct arch_def *arch_def_native = &arch_def_riscv64;
#else
@@ -160,6 +163,8 @@
return &arch_def_s390;
case SCMP_ARCH_S390X:
return &arch_def_s390x;
+ case SCMP_ARCH_E2K:
+ return &arch_def_e2k;
case SCMP_ARCH_RISCV64:
return &arch_def_riscv64;
}
@@ -212,6 +217,8 @@
return &arch_def_s390;
else if (strcmp(arch_name, "s390x") == 0)
return &arch_def_s390x;
+ else if (strcmp(arch_name, "e2k") == 0)
+ return &arch_def_e2k;
else if (strcmp(arch_name, "riscv64") == 0)
return &arch_def_riscv64;
diff -Naur old/src/arch-e2k.c new/src/arch-e2k.c
--- old/src/arch-e2k.c 1970-01-01 03:00:00.000000000 +0300
+++ new/src/arch-e2k.c 2022-03-14 19:38:40.482233276 +0300
@@ -0,0 +1,13 @@
+#include "arch.h"
+#include "arch-e2k.h"
+
+const struct arch_def arch_def_e2k = {
+ .token = SCMP_ARCH_E2K,
+ .token_bpf = AUDIT_ARCH_E2K | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE,
+ .size = ARCH_SIZE_64,
+ .endian = ARCH_ENDIAN_LITTLE,
+ .syscall_resolve_name = e2k_syscall_resolve_name,
+ .syscall_resolve_num = e2k_syscall_resolve_num,
+ .syscall_rewrite = NULL,
+ .rule_add = NULL,
+};
diff -Naur old/src/arch-e2k.h new/src/arch-e2k.h
--- old/src/arch-e2k.h 1970-01-01 03:00:00.000000000 +0300
+++ new/src/arch-e2k.h 2022-03-14 19:40:08.038313562 +0300
@@ -0,0 +1,13 @@
+#ifndef _ARCH_E2K_H
+#define _ARCH_E2K_H
+
+#include "arch.h"
+
+extern const struct arch_def arch_def_e2k;
+
+int e2k_syscall_resolve_name(const char *name);
+const char *e2k_syscall_resolve_num(int num);
+
+const struct arch_syscall_def *e2k_syscall_iterate(unsigned int spot);
+
+#endif
diff -Naur old/src/arch-e2k-syscalls.c new/src/arch-e2k-syscalls.c
--- old/src/arch-e2k-syscalls.c 1970-01-01 03:00:00.000000000 +0300
+++ new/src/arch-e2k-syscalls.c 2022-03-14 19:41:05.052427785 +0300
@@ -0,0 +1,535 @@
+#include <string.h>
+
+#include <seccomp.h>
+
+#include "arch.h"
+#include "arch-e2k.h"
+
+/* NOTE: based on Linux 4.9.0-3.5 */
+const struct arch_syscall_def e2k_syscall_table[] = { \
+ { "_llseek", 140 },
+ { "_newselect", 142 },
+ { "_sysctl", 149 },
+ { "accept", __PNR_accept },
+ { "accept4", 286 },
+ { "access", 33 },
+ { "acct", 51 },
+ { "add_key", 323 },
+ { "adjtimex", 124 },
+ { "afs_syscall", 137 },
+ { "alarm", 27 },
+ { "arm_fadvise64_64", __PNR_arm_fadvise64_64 },
+ { "arm_sync_file_range", __PNR_arm_sync_file_range },
+ { "arch_prctl", __PNR_arch_prctl },
+ { "bdflush", 134 },
+ { "bind", __PNR_bind },
+ { "bpf", 387 },
+ { "break", 17 },
+ { "breakpoint", __PNR_breakpoint },
+ { "brk", 45 },
+ { "cachectl", __PNR_cachectl },
+ { "cacheflush", __PNR_cacheflush },
+ { "capget", 184 },
+ { "capset", 185 },
+ { "chdir", 12 },
+ { "chmod", 15 },
+ { "chown", 182 },
+ { "chown32", 212 },
+ { "chroot", 61 },
+ { "clock_adjtime", 376 },
+ { "clock_getres", 268 },
+ { "clock_gettime", 267 },
+ { "clock_nanosleep", 269 },
+ { "clock_settime", 266 },
+ { "clone", 120 },
+ { "close", 6 },
+ { "connect", __PNR_connect },
+ { "copy_file_range", 394 },
+ { "creat", 8 },
+ { "create_module", 127 },
+ { "delete_module", 129 },
+ { "dup", 41 },
+ { "dup2", 63 },
+ { "dup3", 358 },
+ { "epoll_create", 302 },
+ { "epoll_create1", 360 },
+ { "epoll_ctl", 303 },
+ { "epoll_ctl_old", __PNR_epoll_ctl_old },
+ { "epoll_pwait", 346 },
+ { "epoll_wait", 304 },
+ { "epoll_wait_old", __PNR_epoll_wait_old },
+ { "eventfd", __PNR_eventfd },
+ { "eventfd2", 348 },
+ { "execve", 11 },
+ { "execveat", 388 },
+ { "exit", 1 },
+ { "exit_group", 300 },
+ { "faccessat", 345 },
+ { "fadvise64", 299 },
+ { "fadvise64_64", 310 },
+ { "fallocate", 356 },
+ { "fanotify_init", 373 },
+ { "fanotify_mark", 374 },
+ { "fchdir", 133 },
+ { "fchmod", 94 },
+ { "fchmodat", 344 },
+ { "fchown", 95 },
+ { "fchown32", 207 },
+ { "fchownat", 338 },
+ { "fcntl", 55 },
+ { "fcntl64", 221 },
+ { "fdatasync", 148 },
+ { "fgetxattr", 237 },
+ { "finit_module", 383 },
+ { "flistxattr", 240 },
+ { "flock", 143 },
+ { "fork", 2 },
+ { "fremovexattr", 243 },
+ { "fsetxattr", 234 },
+ { "fstat", 108 },
+ { "fstat64", 197 },
+ { "fstatat64", 361 },
+ { "fstatfs", 100 },
+ { "fstatfs64", 307 },
+ { "fsync", 118 },
+ { "ftime", 35 },
+ { "ftruncate", 93 },
+ { "ftruncate64", 194 },
+ { "futex", 248 },
+ { "futimesat", 362 },
+ { "get_kernel_syms", 130 },
+ { "get_mempolicy", 313 },
+ { "get_robust_list", 365 },
+ { "get_thread_area", __PNR_get_thread_area },
+ { "get_tls", __PNR_get_tls },
+ { "getcpu", 327 },
+ { "getcwd", 183 },
+ { "getdents", 141 },
+ { "getdents64", 220 },
+ { "getegid", 50 },
+ { "getegid32", 202 },
+ { "geteuid", 49 },
+ { "geteuid32", 201 },
+ { "getgid", 47 },
+ { "getgid32", 200 },
+ { "getgroups", 80 },
+ { "getgroups32", __PNR_getgroups32 },
+ { "getitimer", 105 },
+ { "getpeername", __PNR_getpeername },
+ { "getpgid", 132 },
+ { "getpgrp", 65 },
+ { "getpid", 20 },
+ { "getpmsg", 188 },
+ { "getppid", 64 },
+ { "getpriority", 96 },
+ { "getrandom", 385 },
+ { "getresgid", 171 },
+ { "getresgid32", 211 },
+ { "getresuid", 165 },
+ { "getresuid32", 209 },
+ { "getrlimit", 76 },
+ { "getrusage", 77 },
+ { "getsid", 147 },
+ { "getsockname", __PNR_getsockname },
+ { "getsockopt", __PNR_getsockopt },
+ { "gettid", 244 },
+ { "gettimeofday", 78 },
+ { "getuid", 24 },
+ { "getuid32", 199 },
+ { "getxattr", 235 },
+ { "gtty", 32 },
+ { "idle", 112 },
+ { "init_module", 128 },
+ { "inotify_add_watch", 292 },
+ { "inotify_init", 291 },
+ { "inotify_init1", 359 },
+ { "inotify_rm_watch", 293 },
+ { "io_cancel", 298 },
+ { "io_destroy", 295 },
+ { "io_getevents", 296 },
+ { "io_pgetevents", __PNR_io_pgetevents },
+ { "io_setup", 294 },
+ { "io_submit", 297 },
+ { "ioctl", 54 },
+ { "ioperm", 101 },
+ { "iopl", 110 },
+ { "ioprio_get", 290 },
+ { "ioprio_set", 289 },
+ { "ipc", 117 },
+ { "kcmp", 382 },
+ { "kexec_file_load", __PNR_kexec_file_load },
+ { "kexec_load", 321 },
+ { "keyctl", 325 },
+ { "kill", 37 },
+ { "lchown", 16 },
+ { "lchown32", 198 },
+ { "lgetxattr", 236 },
+ { "link", 9 },
+ { "linkat", 341 },
+ { "listen", __PNR_listen },
+ { "listxattr", 238 },
+ { "llistxattr", 239 },
+ { "lock", 53 },
+ { "lookup_dcookie", 301 },
+ { "lremovexattr", 242 },
+ { "lseek", 19 },
+ { "lsetxattr", 233 },
+ { "lstat", 107 },
+ { "lstat64", 196 },
+ { "madvise", 219 },
+ { "mbind", 312 },
+ { "membarrier", 390 },
+ { "memfd_create", 386 },
+ { "migrate_pages", 332 },
+ { "mincore", 218 },
+ { "mkdir", 39 },
+ { "mkdirat", 336 },
+ { "mknod", 14 },
+ { "mknodat", 337 },
+ { "mlock", 150 },
+ { "mlock2", 391 },
+ { "mlockall", 152 },
+ { "mmap", 90 },
+ { "mmap2", 192 },
+ { "modify_ldt", 123 },
+ { "mount", 21 },
+ { "move_pages", 328 },
+ { "mprotect", 125 },
+ { "mpx", 56 },
+ { "mq_getsetattr", 320 },
+ { "mq_notify", 319 },
+ { "mq_open", 315 },
+ { "mq_timedreceive", 318 },
+ { "mq_timedsend", 317 },
+ { "mq_unlink", 316 },
+ { "mremap", 163 },
+ { "msgctl", __PNR_msgctl },
+ { "msgget", __PNR_msgget },
+ { "msgrcv", __PNR_msgrcv },
+ { "msgsnd", __PNR_msgsnd },
+ { "msync", 144 },
+ { "multiplexer", __PNR_multiplexer },
+ { "munlock", 151 },
+ { "munlockall", 153 },
+ { "munmap", 91 },
+ { "name_to_handle_at", 400 },
+ { "nanosleep", 162 },
+ { "newfstatat", 224 },
+ { "nfsservctl", 169 },
+ { "nice", 34 },
+ { "oldfstat", 28 },
+ { "oldlstat", 84 },
+ { "oldolduname", 59 },
+ { "oldstat", 18 },
+ { "olduname", 109 },
+ { "oldwait4", __PNR_oldwait4 },
+ { "open", 5 },
+ { "open_by_handle_at", 401 },
+ { "openat", 335 },
+ { "pause", 29 },
+ { "pciconfig_iobase", __PNR_pciconfig_iobase },
+ { "pciconfig_read", __PNR_pciconfig_read },
+ { "pciconfig_write", __PNR_pciconfig_write },
+ { "perf_event_open", 363 },
+ { "personality", 136 },
+ { "pipe", 42 },
+ { "pipe2", 251 },
+ { "pivot_root", 217 },
+ { "pkey_alloc", 398 },
+ { "pkey_free", 399 },
+ { "pkey_mprotect", 397 },
+ { "poll", 168 },
+ { "ppoll", 368 },
+ { "prctl", 172 },
+ { "pread64", __PNR_pread64 },
+ { "preadv", 354 },
+ { "preadv2", 395 },
+ { "prlimit64", 375 },
+ { "process_vm_readv", 380 },
+ { "process_vm_writev", 381 },
+ { "prof", 44 },
+ { "profil", 98 },
+ { "pselect6", 367 },
+ { "ptrace", 26 },
+ { "putpmsg", 189 },
+ { "pwrite64", __PNR_pwrite64 },
+ { "pwritev", 355 },
+ { "pwritev2", 396 },
+ { "query_module", 167 },
+ { "quotactl", 131 },
+ { "read", 3 },
+ { "readahead", 245 },
+ { "readdir", 89 },
+ { "readlink", 85 },
+ { "readlinkat", 343 },
+ { "readv", 145 },
+ { "reboot", 88 },
+ { "recv", __PNR_recv },
+ { "recvfrom", __PNR_recvfrom },
+ { "recvmmsg", 349 },
+ { "recvmsg", __PNR_recvmsg },
+ { "remap_file_pages", 305 },
+ { "removexattr", 241 },
+ { "rename", 38 },
+ { "renameat", 340 },
+ { "renameat2", 384 },
+ { "request_key", 324 },
+ { "restart_syscall", 0 },
+ { "rmdir", 40 },
+ { "rseq", __PNR_rseq },
+ { "rt_sigaction", 174 },
+ { "rt_sigpending", 176 },
+ { "rt_sigprocmask", 175 },
+ { "rt_sigqueueinfo", 178 },
+ { "rt_sigreturn", 173 },
+ { "rt_sigsuspend", 179 },
+ { "rt_sigtimedwait", 177 },
+ { "rt_tgsigqueueinfo", 334 },
+ { "rtas", __PNR_rtas },
+ { "s390_guarded_storage", __PNR_s390_guarded_storage },
+ { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read },
+ { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write },
+ { "s390_runtime_instr", __PNR_s390_runtime_instr },
+ { "s390_sthyi", __PNR_s390_sthyi },
+ { "sched_get_priority_max", 159 },
+ { "sched_get_priority_min", 160 },
+ { "sched_getaffinity", 250 },
+ { "sched_getattr", 288 },
+ { "sched_getparam", 155 },
+ { "sched_getscheduler", 157 },
+ { "sched_rr_get_interval", 161 },
+ { "sched_setaffinity", 249 },
+ { "sched_setattr", 287 },
+ { "sched_setparam", 154 },
+ { "sched_setscheduler", 156 },
+ { "sched_yield", 158 },
+ { "seccomp", 392 },
+ { "security", __PNR_security },
+ { "select", 82 },
+ { "semctl", __PNR_semctl },
+ { "semget", __PNR_semget },
+ { "semop", __PNR_semop },
+ { "semtimedop", __PNR_semtimedop },
+ { "send", __PNR_send },
+ { "sendfile", 187 },
+ { "sendfile64", 247 },
+ { "sendmmsg", 378 },
+ { "sendmsg", __PNR_sendmsg },
+ { "sendto", __PNR_sendto },
+ { "set_mempolicy", 314 },
+ { "set_robust_list", 366 },
+ { "set_thread_area", __PNR_set_thread_area },
+ { "set_tid_address", 259 },
+ { "set_tls", __PNR_set_tls },
+ { "setdomainname", 121 },
+ { "setfsgid", 139 },
+ { "setfsgid32", 216 },
+ { "setfsuid", 138 },
+ { "setfsuid32", 215 },
+ { "setgid", 46 },
+ { "setgid32", 214 },
+ { "setgroups", 81 },
+ { "setgroups32", __PNR_setgroups32 },
+ { "sethostname", 74 },
+ { "setitimer", 104 },
+ { "setns", 379 },
+ { "setpgid", 57 },
+ { "setpriority", 97 },
+ { "setregid", 71 },
+ { "setregid32", 204 },
+ { "setresgid", 170 },
+ { "setresgid32", 210 },
+ { "setresuid", 164 },
+ { "setresuid32", 208 },
+ { "setreuid", 70 },
+ { "setreuid32", 203 },
+ { "setrlimit", 75 },
+ { "setsid", 66 },
+ { "setsockopt", __PNR_setsockopt },
+ { "settimeofday", 79 },
+ { "setuid", 23 },
+ { "setuid32", 213 },
+ { "setxattr", 232 },
+ { "sgetmask", 68 },
+ { "shmat", __PNR_shmat },
+ { "shmctl", __PNR_shmctl },
+ { "shmdt", __PNR_shmdt },
+ { "shmget", __PNR_shmget },
+ { "shutdown",393 },
+ { "sigaction", 67 },
+ { "sigaltstack", 186 },
+ { "signal", 48 },
+ { "signalfd", __PNR_signalfd },
+ { "signalfd4", 347 },
+ { "sigpending", 73 },
+ { "sigprocmask", 126 },
+ { "sigreturn", 119 },
+ { "sigsuspend", 72 },
+ { "socket", __PNR_socket },
+ { "socketcall", 102 },
+ { "socketpair", __PNR_socketpair },
+ { "splice", 329 },
+ { "spu_create", __PNR_spu_create },
+ { "spu_run", __PNR_spu_run },
+ { "ssetmask", 69 },
+ { "stat", 106 },
+ { "stat64", 195 },
+ { "statfs", 99 },
+ { "statfs64", 306 },
+ { "statx", __PNR_statx },
+ { "stime", 25 },
+ { "stty", 31 },
+ { "subpage_prot", __PNR_subpage_prot },
+ { "swapcontext", 371 },
+ { "swapoff", 115 },
+ { "swapon", 87 },
+ { "switch_endian", __PNR_switch_endian },
+ { "symlink", 83 },
+ { "symlinkat", 342 },
+ { "sync", 36 },
+ { "sync_file_range", 357 },
+ { "sync_file_range2", __PNR_sync_file_range2 },
+ { "syncfs", 377 },
+ { "syscall", __PNR_syscall },
+ { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
+ { "sysfs", 135 },
+ { "sysinfo", 116 },
+ { "syslog", 103 },
+ { "sysmips", __PNR_sysmips },
+ { "tee", 331 },
+ { "tgkill", 308 },
+ { "time", 13 },
+ { "timer_create", 261 },
+ { "timer_delete", 265 },
+ { "timer_getoverrun", 264 },
+ { "timer_gettime", 263 },
+ { "timer_settime", 262 },
+ { "timerfd", __PNR_timerfd },
+ { "timerfd_create", 351 },
+ { "timerfd_gettime", 353 },
+ { "timerfd_settime", 352 },
+ { "times", 43 },
+ { "tkill", 246 },
+ { "truncate", 92 },
+ { "truncate64", 193 },
+ { "tuxcall", __PNR_tuxcall },
+ { "ugetrlimit", 191 },
+ { "ulimit", 58 },
+ { "umask", 60 },
+ { "umount", 22 },
+ { "umount2", 52 },
+ { "uname", 122 },
+ { "unlink", 10 },
+ { "unlinkat", 339 },
+ { "unshare", 364 },
+ { "uselib", 86 },
+ { "userfaultfd", 389 },
+ { "usr26", __PNR_usr26 },
+ { "usr32", __PNR_usr32 },
+ { "ustat", 62 },
+ { "utime", 30 },
+ { "utimensat", 333 },
+ { "utimes", 309 },
+ { "vfork", 190 },
+ { "vhangup", 111 },
+ { "vm86", 166 },
+ { "vm86old", 113 },
+ { "vmsplice", 330 },
+ { "vserver", 311 },
+ { "wait4", 114 },
+ { "waitid", 322 },
+ { "waitpid", 7 },
+ { "write", 4 },
+ { "writev", 146 },
+ { NULL, __NR_SCMP_ERROR },
+
+ // e2k specific or new
+ // i dont wanna to patch all other arches
+ // to pseudo calls
+
+ //{ "access_hw_stacks", 254 },
+ //{ "clone_thread", 229 },
+ //{ "cnt_point", 350 },
+ //{ "core", 222 },
+ //{ "e2k_longjmp2", 230 },
+ //{ "e2k_longjmp", 227 },
+ //{ "e2k_sigsetjmp", 226 },
+ //{ "e2k_syswork", 228 },
+ //{ "emergency", 225 },
+ //{ "freecontext", 372 },
+ //{ "free_mem", 423 },
+ //{ "get_backtrace", 253 },
+ //{ "get_mem", 422 },
+ //{ "macctl", 223 },
+ //{ "makecontext", 370 },
+ //{ "mcst_rt", 326 },
+ //{ "newuselib", 420 },
+ //{ "pread", 180 },
+ //{ "pwrite", 181 },
+ //{ "set_backtrace", 252 },
+ //{ "setcontext", 369 },
+ //{ "soft_debug", 231 },
+};
+
+
+
+/**
+ * Resolve a syscall name to a number
+ * @param name the syscall name
+ *
+ * Resolve the given syscall name to the syscall number using the syscall table.
+ * Returns the syscall number on success, including negative pseudo syscall
+ * numbers; returns __NR_SCMP_ERROR on failure.
+ *
+ */
+int e2k_syscall_resolve_name(const char *name)
+{
+ unsigned int iter;
+ const struct arch_syscall_def *table = e2k_syscall_table;
+
+ /* XXX - plenty of room for future improvement here */
+
+ for (iter = 0; table[iter].name != NULL; iter++) {
+ if (strcmp(name, table[iter].name) == 0)
+ return table[iter].num;
+ }
+
+ return __NR_SCMP_ERROR;
+}
+
+/**
+ * Resolve a syscall number to a name
+ * @param num the syscall number
+ *
+ * Resolve the given syscall number to the syscall name using the syscall table.
+ * Returns a pointer to the syscall name string on success, including pseudo
+ * syscall names; returns NULL on failure.
+ *
+ */
+const char *e2k_syscall_resolve_num(int num)
+{
+ unsigned int iter;
+ const struct arch_syscall_def *table = e2k_syscall_table;
+
+ /* XXX - plenty of room for future improvement here */
+ for (iter = 0; table[iter].num != __NR_SCMP_ERROR; iter++) {
+ if (num == table[iter].num)
+ return table[iter].name;
+ }
+
+ return NULL;
+}
+
+/**
+ * Iterate through the syscall table and return the syscall mapping
+ * @param spot the offset into the syscall table
+ *
+ * Return the syscall mapping at position @spot or NULL on failure. This
+ * function should only ever be used internally by libseccomp.
+ *
+ */
+const struct arch_syscall_def *e2k_syscall_iterate(unsigned int spot)
+{
+ /* XXX - no safety checks here */
+ return &e2k_syscall_table[spot];
+}
diff -Naur old/src/arch-syscall-check.c new/src/arch-syscall-check.c
--- old/src/arch-syscall-check.c 2021-09-01 20:01:27.000000000 +0300
+++ new/src/arch-syscall-check.c 2022-03-14 19:52:30.888295063 +0300
@@ -33,6 +33,7 @@
#include "arch-mips.h"
#include "arch-mips64.h"
#include "arch-mips64n32.h"
+#include "arch-e2k.h"
#include "arch-parisc.h"
#include "arch-ppc.h"
#include "arch-ppc64.h"
@@ -75,6 +76,7 @@
int i_parisc = 0;
int i_ppc = 0;
int i_ppc64 = 0;
+ int i_e2k = 0;
int i_s390 = 0;
int i_s390x = 0;
char str_miss[256];
@@ -111,6 +113,8 @@
ppc_syscall_iterate(i_ppc));
syscall_check(str_miss, sys_name, "ppc64",
ppc64_syscall_iterate(i_ppc64));
+ syscall_check(str_miss, sys_name, "e2k",
+ e2k_syscall_iterate(i_e2k));
syscall_check(str_miss, sys_name, "s390",
s390_syscall_iterate(i_s390));
syscall_check(str_miss, sys_name, "s390x",
@@ -147,6 +151,8 @@
i_ppc = -1;
if (!ppc64_syscall_iterate(++i_ppc64)->name)
i_ppc64 = -1;
+ if (!e2k_syscall_iterate(++i_e2k)->name)
+ i_e2k = -1;
if (!s390_syscall_iterate(++i_s390)->name)
i_s390 = -1;
if (!s390x_syscall_iterate(++i_s390x)->name)
@@ -155,6 +161,7 @@
i_arm >= 0 && i_aarch64 >= 0 &&
i_mips >= 0 && i_mips64 >= 0 && i_mips64n32 >= 0 &&
i_parisc >= 0 &&
+ i_e2k >= 0 &&
i_ppc >= 0 && i_ppc64 >= 0 &&
i_s390 >= 0 && i_s390x >= 0);
@@ -204,6 +211,10 @@
printf("ERROR, ppc64 has additional syscalls\n");
return 1;
}
+ if (i_e2k >= 0) {
+ printf("ERROR, e2k has additional syscalls\n");
+ return 1;
+ }
if (i_s390 >= 0) {
printf("ERROR, s390 has additional syscalls\n");
return 1;
diff -Naur old/src/arch-syscall-dump.c new/src/arch-syscall-dump.c
--- old/src/arch-syscall-dump.c 2021-09-01 20:01:27.000000000 +0300
+++ new/src/arch-syscall-dump.c 2022-03-14 19:54:12.387056934 +0300
@@ -43,6 +43,7 @@
#include "arch-ppc.h"
#include "arch-ppc64.h"
#include "arch-riscv64.h"
+#include "arch-e2k.h"
#include "arch-s390.h"
#include "arch-s390x.h"
@@ -134,6 +135,9 @@
case SCMP_ARCH_RISCV64:
sys = riscv64_syscall_iterate(iter);
break;
+ case SCMP_ARCH_E2K:
+ sys = e2k_syscall_iterate(iter);
+ break;
case SCMP_ARCH_S390:
sys = s390_syscall_iterate(iter);
break;
diff -Naur old/src/gen_pfc.c new/src/gen_pfc.c
--- old/src/gen_pfc.c 2021-09-01 20:01:27.000000000 +0300
+++ new/src/gen_pfc.c 2022-03-14 19:55:26.050405812 +0300
@@ -83,6 +83,8 @@
return "ppc64le";
case SCMP_ARCH_PPC:
return "ppc";
+ case SCMP_ARCH_E2K:
+ return "e2k";
case SCMP_ARCH_S390X:
return "s390x";
case SCMP_ARCH_S390:
diff -Naur old/src/Makefile.am new/src/Makefile.am
--- old/src/Makefile.am 2021-09-01 20:01:27.000000000 +0300
+++ new/src/Makefile.am 2022-03-14 19:57:12.798931239 +0300
@@ -40,6 +40,7 @@
arch-ppc.h arch-ppc.c \
arch-ppc64.h arch-ppc64.c \
arch-riscv64.h arch-riscv64.c \
+ arch-e2k.h arch-e2k.c arch-e2k-syscalls.c \
arch-s390.h arch-s390.c \
arch-s390x.h arch-s390x.c \
syscalls.h syscalls.c syscalls.perf.c
diff -Naur old/src/Makefile.in new/src/Makefile.in
--- old/src/Makefile.in 2021-09-01 20:39:09.000000000 +0300
+++ new/src/Makefile.in 2022-03-14 20:39:14.905331389 +0300
@@ -163,7 +163,8 @@
libseccomp_la-arch-mips64.lo libseccomp_la-arch-mips64n32.lo \
libseccomp_la-arch-parisc.lo libseccomp_la-arch-parisc64.lo \
libseccomp_la-arch-ppc.lo libseccomp_la-arch-ppc64.lo \
- libseccomp_la-arch-riscv64.lo libseccomp_la-arch-s390.lo \
+ libseccomp_la-arch-riscv64.lo libseccomp_la-arch-e2k.lo \
+ libseccomp_la-arch-e2k-syscalls.lo libseccomp_la-arch-s390.lo \
libseccomp_la-arch-s390x.lo libseccomp_la-syscalls.lo \
libseccomp_la-syscalls.perf.lo
am_libseccomp_la_OBJECTS = $(am__objects_1)
@@ -196,6 +197,8 @@
arch_syscall_check-arch-ppc.$(OBJEXT) \
arch_syscall_check-arch-ppc64.$(OBJEXT) \
arch_syscall_check-arch-riscv64.$(OBJEXT) \
+ arch_syscall_check-arch-e2k.$(OBJEXT) \
+ arch_syscall_check-arch-e2k-syscalls.$(OBJEXT) \
arch_syscall_check-arch-s390.$(OBJEXT) \
arch_syscall_check-arch-s390x.$(OBJEXT) \
arch_syscall_check-syscalls.$(OBJEXT) \
@@ -217,7 +220,8 @@
arch-mips64.$(OBJEXT) arch-mips64n32.$(OBJEXT) \
arch-parisc.$(OBJEXT) arch-parisc64.$(OBJEXT) \
arch-ppc.$(OBJEXT) arch-ppc64.$(OBJEXT) arch-riscv64.$(OBJEXT) \
- arch-s390.$(OBJEXT) arch-s390x.$(OBJEXT) syscalls.$(OBJEXT) \
+ arch-s390.$(OBJEXT) arch-s390x.$(OBJEXT) \
+ arch-e2k.$(OBJEXT) syscalls.$(OBJEXT) \
syscalls.perf.$(OBJEXT)
am_arch_syscall_dump_OBJECTS = arch-syscall-dump.$(OBJEXT) \
$(am__objects_3)
@@ -238,7 +242,8 @@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__maybe_remake_depfiles = depfiles
-am__depfiles_remade = ./$(DEPDIR)/api.Po ./$(DEPDIR)/arch-aarch64.Po \
+am__depfiles_remade = ./$(DEPDIR)/api.Po \
+ ./$(DEPDIR)/arch-e2k.Po ./$(DEPDIR)/arch-aarch64.Po \
./$(DEPDIR)/arch-arm.Po ./$(DEPDIR)/arch-mips.Po \
./$(DEPDIR)/arch-mips64.Po ./$(DEPDIR)/arch-mips64n32.Po \
./$(DEPDIR)/arch-parisc.Po ./$(DEPDIR)/arch-parisc64.Po \
@@ -258,6 +263,7 @@
./$(DEPDIR)/arch_syscall_check-arch-ppc.Po \
./$(DEPDIR)/arch_syscall_check-arch-ppc64.Po \
./$(DEPDIR)/arch_syscall_check-arch-riscv64.Po \
+ ./$(DEPDIR)/arch_syscall_check-arch-e2k.Po \
./$(DEPDIR)/arch_syscall_check-arch-s390.Po \
./$(DEPDIR)/arch_syscall_check-arch-s390x.Po \
./$(DEPDIR)/arch_syscall_check-arch-syscall-check.Po \
@@ -286,6 +292,7 @@
./$(DEPDIR)/libseccomp_la-arch-ppc.Plo \
./$(DEPDIR)/libseccomp_la-arch-ppc64.Plo \
./$(DEPDIR)/libseccomp_la-arch-riscv64.Plo \
+ ./$(DEPDIR)/libseccomp_la-arch-e2k.Plo \
./$(DEPDIR)/libseccomp_la-arch-s390.Plo \
./$(DEPDIR)/libseccomp_la-arch-s390x.Plo \
./$(DEPDIR)/libseccomp_la-arch-x32.Plo \
@@ -578,6 +585,7 @@
arch-ppc.h arch-ppc.c \
arch-ppc64.h arch-ppc64.c \
arch-riscv64.h arch-riscv64.c \
+ arch-e2k.h arch-e2k.c \
arch-s390.h arch-s390.c \
arch-s390x.h arch-s390x.c \
syscalls.h syscalls.c syscalls.perf.c
@@ -703,6 +711,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-ppc.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-ppc64.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-riscv64.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-e2k.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-s390.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-s390x.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-syscall-dump.Po@am__quote@ # am--include-marker
@@ -721,6 +730,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch_syscall_check-arch-ppc.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch_syscall_check-arch-ppc64.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch_syscall_check-arch-riscv64.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch_syscall_check-arch-e2k.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch_syscall_check-arch-s390.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch_syscall_check-arch-s390x.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch_syscall_check-arch-syscall-check.Po@am__quote@ # am--include-marker
@@ -752,6 +762,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-ppc.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-ppc64.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-riscv64.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-e2k.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-s390.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-s390x.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-x32.Plo@am__quote@ # am--include-marker
@@ -800,6 +811,20 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+libseccomp_la-arch-e2k.lo: arch-e2k.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-e2k.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-e2k.Tpo -c -o libseccomp_la-arch-e2k.lo `test -f 'arch-e2k.c' || echo '$(srcdir)/'`arch-e2k.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-e2k.Tpo $(DEPDIR)/libseccomp_la-arch-e2k.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-e2k.c' object='libseccomp_la-arch-e2k.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-e2k.lo `test -f 'arch-e2k.c' || echo '$(srcdir)/'`arch-e2k.c
+
+libseccomp_la-arch-e2k-syscalls.lo: arch-e2k-syscalls.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-e2k-syscalls.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-e2k-syscalls.Tpo -c -o libseccomp_la-arch-e2k-syscalls.lo `test -f 'arch-e2k-syscalls.c' || echo '$(srcdir)/'`arch-e2k-syscalls.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-e2k-syscalls.Tpo $(DEPDIR)/libseccomp_la-arch-e2k-syscalls.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-e2k-syscalls.c' object='libseccomp_la-arch-e2k-syscalls.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-e2k-syscalls.lo `test -f 'arch-e2k-syscalls.c' || echo '$(srcdir)/'`arch-e2k-syscalls.c
+
libseccomp_la-api.lo: api.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-api.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-api.Tpo -c -o libseccomp_la-api.lo `test -f 'api.c' || echo '$(srcdir)/'`api.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-api.Tpo $(DEPDIR)/libseccomp_la-api.Plo
@@ -1339,6 +1364,34 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(arch_syscall_check_CFLAGS) $(CFLAGS) -c -o arch_syscall_check-syscalls.perf.obj `if test -f 'syscalls.perf.c'; then $(CYGPATH_W) 'syscalls.perf.c'; else $(CYGPATH_W) '$(srcdir)/syscalls.perf.c'; fi`
+arch_syscall_check-arch-e2k.o: arch-e2k.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(arch_syscall_check_CFLAGS) $(CFLAGS) -MT arch_syscall_check-arch-e2k.o -MD -MP -MF $(DEPDIR)/arch_syscall_check-arch-e2k.Tpo -c -o arch_syscall_check-arch-e2k.o `test -f 'arch-e2k.c' || echo '$(srcdir)/'`arch-e2k.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/arch_syscall_check-arch-e2k.Tpo $(DEPDIR)/arch_syscall_check-arch-e2k.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-e2k.c' object='arch_syscall_check-arch-e2k.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(arch_syscall_check_CFLAGS) $(CFLAGS) -c -o arch_syscall_check-arch-e2k.o `test -f 'arch-e2k.c' || echo '$(srcdir)/'`arch-e2k.c
+
+arch_syscall_check-arch-e2k.obj: arch-e2k.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(arch_syscall_check_CFLAGS) $(CFLAGS) -MT arch_syscall_check-arch-e2k.obj -MD -MP -MF $(DEPDIR)/arch_syscall_check-arch-e2k.Tpo -c -o arch_syscall_check-arch-e2k.obj `if test -f 'arch-e2k.c'; then $(CYGPATH_W) 'arch-e2k.c'; else $(CYGPATH_W) '$(srcdir)/arch-e2k.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/arch_syscall_check-arch-e2k.Tpo $(DEPDIR)/arch_syscall_check-arch-e2k.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-e2k.c' object='arch_syscall_check-arch-e2k.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(arch_syscall_check_CFLAGS) $(CFLAGS) -c -o arch_syscall_check-arch-e2k.obj `if test -f 'arch-e2k.c'; then $(CYGPATH_W) 'arch-e2k.c'; else $(CYGPATH_W) '$(srcdir)/arch-e2k.c'; fi`
+
+arch_syscall_check-arch-e2k-syscalls.o: arch-e2k-syscalls.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(arch_syscall_check_CFLAGS) $(CFLAGS) -MT arch_syscall_check-arch-e2k-syscalls.o -MD -MP -MF $(DEPDIR)/arch_syscall_check-arch-e2k-syscalls.Tpo -c -o arch_syscall_check-arch-e2k-syscalls.o `test -f 'arch-e2k-syscalls.c' || echo '$(srcdir)/'`arch-e2k-syscalls.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/arch_syscall_check-arch-e2k-syscalls.Tpo $(DEPDIR)/arch_syscall_check-arch-e2k-syscalls.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-e2k-syscalls.c' object='arch_syscall_check-arch-e2k-syscalls.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(arch_syscall_check_CFLAGS) $(CFLAGS) -c -o arch_syscall_check-arch-e2k-syscalls.o `test -f 'arch-e2k-syscalls.c' || echo '$(srcdir)/'`arch-e2k-syscalls.c
+
+arch_syscall_check-arch-e2k-syscalls.obj: arch-e2k-syscalls.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(arch_syscall_check_CFLAGS) $(CFLAGS) -MT arch_syscall_check-arch-e2k-syscalls.obj -MD -MP -MF $(DEPDIR)/arch_syscall_check-arch-e2k-syscalls.Tpo -c -o arch_syscall_check-arch-e2k-syscalls.obj `if test -f 'arch-e2k-syscalls.c'; then $(CYGPATH_W) 'arch-e2k-syscalls.c'; else $(CYGPATH_W) '$(srcdir)/arch-e2k-syscalls.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/arch_syscall_check-arch-e2k-syscalls.Tpo $(DEPDIR)/arch_syscall_check-arch-e2k-syscalls.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-e2k-syscalls.c' object='arch_syscall_check-arch-e2k-syscalls.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(arch_syscall_check_CFLAGS) $(CFLAGS) -c -o arch_syscall_check-arch-e2k-syscalls.obj `if test -f 'arch-e2k-syscalls.c'; then $(CYGPATH_W) 'arch-e2k-syscalls.c'; else $(CYGPATH_W) '$(srcdir)/arch-e2k-syscalls.c'; fi`
+
mostlyclean-libtool:
-rm -f *.lo
@@ -1653,6 +1706,7 @@
-rm -f ./$(DEPDIR)/arch-ppc.Po
-rm -f ./$(DEPDIR)/arch-ppc64.Po
-rm -f ./$(DEPDIR)/arch-riscv64.Po
+ -rm -f ./$(DEPDIR)/arch-e2k.Po
-rm -f ./$(DEPDIR)/arch-s390.Po
-rm -f ./$(DEPDIR)/arch-s390x.Po
-rm -f ./$(DEPDIR)/arch-syscall-dump.Po
@@ -1671,6 +1725,7 @@
-rm -f ./$(DEPDIR)/arch_syscall_check-arch-ppc.Po
-rm -f ./$(DEPDIR)/arch_syscall_check-arch-ppc64.Po
-rm -f ./$(DEPDIR)/arch_syscall_check-arch-riscv64.Po
+ -rm -f ./$(DEPDIR)/arch_syscall_check-arch-e2k.Po
-rm -f ./$(DEPDIR)/arch_syscall_check-arch-s390.Po
-rm -f ./$(DEPDIR)/arch_syscall_check-arch-s390x.Po
-rm -f ./$(DEPDIR)/arch_syscall_check-arch-syscall-check.Po
@@ -1702,6 +1757,7 @@
-rm -f ./$(DEPDIR)/libseccomp_la-arch-ppc.Plo
-rm -f ./$(DEPDIR)/libseccomp_la-arch-ppc64.Plo
-rm -f ./$(DEPDIR)/libseccomp_la-arch-riscv64.Plo
+ -rm -f ./$(DEPDIR)/libseccomp_la-arch-e2k.Plo
-rm -f ./$(DEPDIR)/libseccomp_la-arch-s390.Plo
-rm -f ./$(DEPDIR)/libseccomp_la-arch-s390x.Plo
-rm -f ./$(DEPDIR)/libseccomp_la-arch-x32.Plo
@@ -1775,6 +1831,7 @@
-rm -f ./$(DEPDIR)/arch-ppc.Po
-rm -f ./$(DEPDIR)/arch-ppc64.Po
-rm -f ./$(DEPDIR)/arch-riscv64.Po
+ -rm -f ./$(DEPDIR)/arch-e2k.Po
-rm -f ./$(DEPDIR)/arch-s390.Po
-rm -f ./$(DEPDIR)/arch-s390x.Po
-rm -f ./$(DEPDIR)/arch-syscall-dump.Po
@@ -1793,6 +1850,7 @@
-rm -f ./$(DEPDIR)/arch_syscall_check-arch-ppc.Po
-rm -f ./$(DEPDIR)/arch_syscall_check-arch-ppc64.Po
-rm -f ./$(DEPDIR)/arch_syscall_check-arch-riscv64.Po
+ -rm -f ./$(DEPDIR)/arch_syscall_check-arch-e2k.Po
-rm -f ./$(DEPDIR)/arch_syscall_check-arch-s390.Po
-rm -f ./$(DEPDIR)/arch_syscall_check-arch-s390x.Po
-rm -f ./$(DEPDIR)/arch_syscall_check-arch-syscall-check.Po
@@ -1824,6 +1882,7 @@
-rm -f ./$(DEPDIR)/libseccomp_la-arch-ppc.Plo
-rm -f ./$(DEPDIR)/libseccomp_la-arch-ppc64.Plo
-rm -f ./$(DEPDIR)/libseccomp_la-arch-riscv64.Plo
+ -rm -f ./$(DEPDIR)/libseccomp_la-arch-e2k.Plo
-rm -f ./$(DEPDIR)/libseccomp_la-arch-s390.Plo
-rm -f ./$(DEPDIR)/libseccomp_la-arch-s390x.Plo
-rm -f ./$(DEPDIR)/libseccomp_la-arch-x32.Plo
diff -Naur old/src/python/libseccomp.pxd new/src/python/libseccomp.pxd
--- old/src/python/libseccomp.pxd 2021-09-01 19:57:34.000000000 +0300
+++ new/src/python/libseccomp.pxd 2022-03-14 20:40:16.382562497 +0300
@@ -49,6 +49,7 @@
SCMP_ARCH_PPC
SCMP_ARCH_PPC64
SCMP_ARCH_PPC64LE
+ SCMP_ARCH_E2K
SCMP_ARCH_S390
SCMP_ARCH_S390X
SCMP_ARCH_RISCV64
diff -Naur old/src/python/seccomp.pyx new/src/python/seccomp.pyx
--- old/src/python/seccomp.pyx 2021-09-01 19:57:34.000000000 +0300
+++ new/src/python/seccomp.pyx 2022-03-14 20:44:04.005643583 +0300
@@ -212,6 +212,7 @@
MIPSEL64N32 - MIPS little endian N32 ABI
PARISC - 32-bit PA-RISC
PARISC64 - 64-bit PA-RISC
+ E2K - 64-bit Elbrus
PPC64 - 64-bit PowerPC
PPC - 32-bit PowerPC
RISCV64 - 64-bit RISC-V
@@ -236,6 +237,7 @@
PPC = libseccomp.SCMP_ARCH_PPC
PPC64 = libseccomp.SCMP_ARCH_PPC64
PPC64LE = libseccomp.SCMP_ARCH_PPC64LE
+ E2K = libseccomp.SCMP_ARCH_E2K
S390 = libseccomp.SCMP_ARCH_S390
S390X = libseccomp.SCMP_ARCH_S390X
RISCV64 = libseccomp.SCMP_ARCH_RISCV64
@@ -284,6 +286,8 @@
self._token = libseccomp.SCMP_ARCH_PPC64
elif arch == libseccomp.SCMP_ARCH_PPC64LE:
self._token = libseccomp.SCMP_ARCH_PPC64LE
+ elif arch == libseccomp.SCMP_ARCH_E2K:
+ self._token = libseccomp.SCMP_ARCH_E2K
elif arch == libseccomp.SCMP_ARCH_S390:
self._token = libseccomp.SCMP_ARCH_S390
elif arch == libseccomp.SCMP_ARCH_S390X:
diff -Naur old/tests/16-sim-arch_basic.c new/tests/16-sim-arch_basic.c
--- old/tests/16-sim-arch_basic.c 2021-09-01 20:01:27.000000000 +0300
+++ new/tests/16-sim-arch_basic.c 2022-03-14 20:46:24.182662974 +0300
@@ -89,6 +89,9 @@
rc = seccomp_arch_add(ctx, SCMP_ARCH_MIPSEL64N32);
if (rc != 0)
goto out;
+ rc = seccomp_arch_add(ctx, SCMP_ARCH_E2K);
+ if (rc != 0)
+ goto out;
rc = seccomp_arch_add(ctx, SCMP_ARCH_PPC64LE);
if (rc != 0)
goto out;
@@ -153,6 +156,9 @@
rc = seccomp_arch_remove(ctx, SCMP_ARCH_MIPSEL64);
if (rc != 0)
goto out;
+ rc = seccomp_arch_remove(ctx, SCMP_ARCH_E2K);
+ if (rc != 0)
+ goto out;
rc = seccomp_arch_remove(ctx, SCMP_ARCH_MIPSEL64N32);
if (rc != 0)
goto out;
diff -Naur old/tests/23-sim-arch_all_le_basic.c new/tests/23-sim-arch_all_le_basic.c
--- old/tests/23-sim-arch_all_le_basic.c 2021-09-01 20:01:27.000000000 +0300
+++ new/tests/23-sim-arch_all_le_basic.c 2022-03-14 20:47:30.373014913 +0300
@@ -68,6 +68,9 @@
rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("mipsel64n32"));
if (rc != 0)
goto out;
+ rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("e2k"));
+ if (rc != 0)
+ goto out;
rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("ppc64le"));
if (rc != 0)
goto out;
diff -Naur old/tests/regression new/tests/regression
--- old/tests/regression 2021-09-01 20:01:27.000000000 +0300
+++ new/tests/regression 2022-03-14 20:50:15.688902009 +0300
@@ -25,6 +25,7 @@
x86 x86_64 x32 \
arm aarch64 \
mipsel mipsel64 mipsel64n32 \
+ e2k \
ppc64le \
riscv64"
GLBL_ARCH_BE_SUPPORT=" \
@@ -47,6 +48,7 @@
mips64 \
parisc64 \
ppc64 \
+ e2k \
riscv64 \
s390x"
@@ -796,7 +798,7 @@
# setup the arch specific return values
case "$arch" in
- x86|x86_64|x32|arm|aarch64|parisc|parisc64|ppc|ppc64|ppc64le|ppc|s390|s390x|riscv64)
+ x86|x86_64|x32|arm|aarch64|parisc|parisc64|ppc|ppc64|ppc64le|ppc|s390|s390x|riscv64|e2k)
rc_kill_process=159
rc_kill=159
rc_allow=160
diff -Naur old/tools/scmp_arch_detect.c new/tools/scmp_arch_detect.c
--- old/tools/scmp_arch_detect.c 2021-09-01 20:01:27.000000000 +0300
+++ new/tools/scmp_arch_detect.c 2022-03-14 20:51:16.719486361 +0300
@@ -114,6 +114,9 @@
case SCMP_ARCH_PPC64LE:
printf("ppc64le\n");
break;
+ case SCMP_ARCH_E2K:
+ printf("e2k\n");
+ break;
case SCMP_ARCH_S390:
printf("s390\n");
break;
diff -Naur old/tools/scmp_bpf_sim.c new/tools/scmp_bpf_sim.c
--- old/tools/scmp_bpf_sim.c 2021-09-01 20:01:27.000000000 +0300
+++ new/tools/scmp_bpf_sim.c 2022-03-14 20:51:38.368511238 +0300
@@ -281,6 +281,8 @@
arch = AUDIT_ARCH_PPC64;
else if (strcmp(optarg, "ppc64le") == 0)
arch = AUDIT_ARCH_PPC64LE;
+ else if (strcmp(optarg, "e2k") == 0)
+ arch = AUDIT_ARCH_E2K | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE;
else if (strcmp(optarg, "s390") == 0)
arch = AUDIT_ARCH_S390;
else if (strcmp(optarg, "s390x") == 0)
diff -Naur old/tools/util.c new/tools/util.c
--- old/tools/util.c 2021-09-01 20:01:27.000000000 +0300
+++ new/tools/util.c 2022-03-14 20:53:14.880830742 +0300
@@ -74,6 +74,8 @@
#endif
#elif __PPC__
#define ARCH_NATIVE AUDIT_ARCH_PPC
+#elif __e2k__
+#define ARCH_NATIVE (AUDIT_ARCH_E2K | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
#elif __s390x__ /* s390x must be checked before s390 */
#define ARCH_NATIVE AUDIT_ARCH_S390X
#elif __s390__