1 /* SPDX-License-Identifier: LGPL-2.1+ */
6 #include <sys/eventfd.h>
8 #include <sys/personality.h>
10 #include <sys/types.h>
13 #include "alloc-util.h"
18 #include "process-util.h"
19 #include "raw-clone.h"
20 #include "seccomp-util.h"
22 #include "string-util.h"
27 #if SCMP_SYS(socket) < 0 || defined(__i386__) || defined(__s390x__) || defined(__s390__)
28 /* On these archs, socket() is implemented via the socketcall() syscall multiplexer,
29 * and we can't restrict it hence via seccomp. */
30 # define SECCOMP_RESTRICT_ADDRESS_FAMILIES_BROKEN 1
32 # define SECCOMP_RESTRICT_ADDRESS_FAMILIES_BROKEN 0
35 static void test_seccomp_arch_to_string(void) {
39 log_info("/* %s */", __func__
);
41 a
= seccomp_arch_native();
43 name
= seccomp_arch_to_string(a
);
45 assert_se(seccomp_arch_from_string(name
, &b
) >= 0);
49 static void test_architecture_table(void) {
52 log_info("/* %s */", __func__
);
74 assert_se(seccomp_arch_from_string(n
, &c
) >= 0);
75 n2
= seccomp_arch_to_string(c
);
76 log_info("seccomp-arch: %s → 0x%"PRIx32
" → %s", n
, c
, n2
);
77 assert_se(streq_ptr(n
, n2
));
81 static void test_syscall_filter_set_find(void) {
82 log_info("/* %s */", __func__
);
84 assert_se(!syscall_filter_set_find(NULL
));
85 assert_se(!syscall_filter_set_find(""));
86 assert_se(!syscall_filter_set_find("quux"));
87 assert_se(!syscall_filter_set_find("@quux"));
89 assert_se(syscall_filter_set_find("@clock") == syscall_filter_sets
+ SYSCALL_FILTER_SET_CLOCK
);
90 assert_se(syscall_filter_set_find("@default") == syscall_filter_sets
+ SYSCALL_FILTER_SET_DEFAULT
);
91 assert_se(syscall_filter_set_find("@raw-io") == syscall_filter_sets
+ SYSCALL_FILTER_SET_RAW_IO
);
94 static void test_filter_sets(void) {
98 log_info("/* %s */", __func__
);
100 if (!is_seccomp_available()) {
101 log_notice("Seccomp not available, skipping %s", __func__
);
104 if (geteuid() != 0) {
105 log_notice("Not root, skipping %s", __func__
);
109 for (i
= 0; i
< _SYSCALL_FILTER_SET_MAX
; i
++) {
112 log_info("Testing %s", syscall_filter_sets
[i
].name
);
117 if (pid
== 0) { /* Child? */
120 /* If we look at the default set (or one that includes it), whitelist instead of blacklist */
121 if (IN_SET(i
, SYSCALL_FILTER_SET_DEFAULT
, SYSCALL_FILTER_SET_SYSTEM_SERVICE
))
122 r
= seccomp_load_syscall_filter_set(SCMP_ACT_ERRNO(EUCLEAN
), syscall_filter_sets
+ i
, SCMP_ACT_ALLOW
, true);
124 r
= seccomp_load_syscall_filter_set(SCMP_ACT_ALLOW
, syscall_filter_sets
+ i
, SCMP_ACT_ERRNO(EUCLEAN
), true);
128 /* Test the sycall filter with one random system call */
129 fd
= eventfd(0, EFD_NONBLOCK
|EFD_CLOEXEC
);
130 if (IN_SET(i
, SYSCALL_FILTER_SET_IO_EVENT
, SYSCALL_FILTER_SET_DEFAULT
))
131 assert_se(fd
< 0 && errno
== EUCLEAN
);
140 assert_se(wait_for_terminate_and_check(syscall_filter_sets
[i
].name
, pid
, WAIT_LOG
) == EXIT_SUCCESS
);
144 static void test_filter_sets_ordered(void) {
147 log_info("/* %s */", __func__
);
149 /* Ensure "@default" always remains at the beginning of the list */
150 assert_se(SYSCALL_FILTER_SET_DEFAULT
== 0);
151 assert_se(streq(syscall_filter_sets
[0].name
, "@default"));
153 for (i
= 0; i
< _SYSCALL_FILTER_SET_MAX
; i
++) {
154 const char *k
, *p
= NULL
;
156 /* Make sure each group has a description */
157 assert_se(!isempty(syscall_filter_sets
[0].help
));
159 /* Make sure the groups are ordered alphabetically, except for the first entry */
160 assert_se(i
< 2 || strcmp(syscall_filter_sets
[i
-1].name
, syscall_filter_sets
[i
].name
) < 0);
162 NULSTR_FOREACH(k
, syscall_filter_sets
[i
].value
) {
164 /* Ensure each syscall list is in itself ordered, but groups before names */
166 (*p
== '@' && *k
!= '@') ||
167 (((*p
== '@' && *k
== '@') ||
168 (*p
!= '@' && *k
!= '@')) &&
176 static void test_restrict_namespace(void) {
181 log_info("/* %s */", __func__
);
183 assert_se(namespace_flags_to_string(0, &s
) == 0 && streq(s
, ""));
185 assert_se(namespace_flags_to_string(CLONE_NEWNS
, &s
) == 0 && streq(s
, "mnt"));
187 assert_se(namespace_flags_to_string(CLONE_NEWNS
|CLONE_NEWIPC
, &s
) == 0 && streq(s
, "ipc mnt"));
189 assert_se(namespace_flags_to_string(CLONE_NEWCGROUP
, &s
) == 0 && streq(s
, "cgroup"));
192 assert_se(namespace_flags_from_string("mnt", &ul
) == 0 && ul
== CLONE_NEWNS
);
193 assert_se(namespace_flags_from_string(NULL
, &ul
) == 0 && ul
== 0);
194 assert_se(namespace_flags_from_string("", &ul
) == 0 && ul
== 0);
195 assert_se(namespace_flags_from_string("uts", &ul
) == 0 && ul
== CLONE_NEWUTS
);
196 assert_se(namespace_flags_from_string("mnt uts ipc", &ul
) == 0 && ul
== (CLONE_NEWNS
|CLONE_NEWUTS
|CLONE_NEWIPC
));
198 assert_se(namespace_flags_to_string(CLONE_NEWUTS
, &s
) == 0 && streq(s
, "uts"));
199 assert_se(namespace_flags_from_string(s
, &ul
) == 0 && ul
== CLONE_NEWUTS
);
201 assert_se(namespace_flags_from_string("ipc", &ul
) == 0 && ul
== CLONE_NEWIPC
);
202 assert_se(namespace_flags_to_string(ul
, &s
) == 0 && streq(s
, "ipc"));
205 assert_se(namespace_flags_to_string(NAMESPACE_FLAGS_ALL
, &s
) == 0);
206 assert_se(streq(s
, "cgroup ipc net mnt pid user uts"));
207 assert_se(namespace_flags_from_string(s
, &ul
) == 0 && ul
== NAMESPACE_FLAGS_ALL
);
210 if (!is_seccomp_available()) {
211 log_notice("Seccomp not available, skipping remaining tests in %s", __func__
);
214 if (geteuid() != 0) {
215 log_notice("Not root, skipping remaining tests in %s", __func__
);
224 assert_se(seccomp_restrict_namespaces(CLONE_NEWNS
|CLONE_NEWNET
) >= 0);
226 assert_se(unshare(CLONE_NEWNS
) == 0);
227 assert_se(unshare(CLONE_NEWNET
) == 0);
228 assert_se(unshare(CLONE_NEWUTS
) == -1);
229 assert_se(errno
== EPERM
);
230 assert_se(unshare(CLONE_NEWIPC
) == -1);
231 assert_se(errno
== EPERM
);
232 assert_se(unshare(CLONE_NEWNET
|CLONE_NEWUTS
) == -1);
233 assert_se(errno
== EPERM
);
235 /* We use fd 0 (stdin) here, which of course will fail with EINVAL on setns(). Except of course our
236 * seccomp filter worked, and hits first and makes it return EPERM */
237 assert_se(setns(0, CLONE_NEWNS
) == -1);
238 assert_se(errno
== EINVAL
);
239 assert_se(setns(0, CLONE_NEWNET
) == -1);
240 assert_se(errno
== EINVAL
);
241 assert_se(setns(0, CLONE_NEWUTS
) == -1);
242 assert_se(errno
== EPERM
);
243 assert_se(setns(0, CLONE_NEWIPC
) == -1);
244 assert_se(errno
== EPERM
);
245 assert_se(setns(0, CLONE_NEWNET
|CLONE_NEWUTS
) == -1);
246 assert_se(errno
== EPERM
);
247 assert_se(setns(0, 0) == -1);
248 assert_se(errno
== EPERM
);
250 pid
= raw_clone(CLONE_NEWNS
);
254 pid
= raw_clone(CLONE_NEWNET
);
258 pid
= raw_clone(CLONE_NEWUTS
);
260 assert_se(errno
== EPERM
);
261 pid
= raw_clone(CLONE_NEWIPC
);
263 assert_se(errno
== EPERM
);
264 pid
= raw_clone(CLONE_NEWNET
|CLONE_NEWUTS
);
266 assert_se(errno
== EPERM
);
271 assert_se(wait_for_terminate_and_check("nsseccomp", pid
, WAIT_LOG
) == EXIT_SUCCESS
);
274 static void test_protect_sysctl(void) {
277 log_info("/* %s */", __func__
);
279 if (!is_seccomp_available()) {
280 log_notice("Seccomp not available, skipping %s", __func__
);
283 if (geteuid() != 0) {
284 log_notice("Not root, skipping %s", __func__
);
288 /* in containers _sysctl() is likely missing anyway */
289 if (detect_container() > 0) {
290 log_notice("Testing in container, skipping %s", __func__
);
299 assert_se(syscall(__NR__sysctl
, NULL
) < 0);
300 assert_se(errno
== EFAULT
);
303 assert_se(seccomp_protect_sysctl() >= 0);
306 assert_se(syscall(__NR__sysctl
, 0, 0, 0) < 0);
307 assert_se(errno
== EPERM
);
313 assert_se(wait_for_terminate_and_check("sysctlseccomp", pid
, WAIT_LOG
) == EXIT_SUCCESS
);
316 static void test_restrict_address_families(void) {
319 log_info("/* %s */", __func__
);
321 if (!is_seccomp_available()) {
322 log_notice("Seccomp not available, skipping %s", __func__
);
325 if (geteuid() != 0) {
326 log_notice("Not root, skipping %s", __func__
);
337 fd
= socket(AF_INET
, SOCK_DGRAM
, 0);
341 fd
= socket(AF_UNIX
, SOCK_DGRAM
, 0);
345 fd
= socket(AF_NETLINK
, SOCK_DGRAM
, 0);
349 assert_se(s
= set_new(NULL
));
350 assert_se(set_put(s
, INT_TO_PTR(AF_UNIX
)) >= 0);
352 assert_se(seccomp_restrict_address_families(s
, false) >= 0);
354 fd
= socket(AF_INET
, SOCK_DGRAM
, 0);
358 fd
= socket(AF_UNIX
, SOCK_DGRAM
, 0);
359 #if SECCOMP_RESTRICT_ADDRESS_FAMILIES_BROKEN
364 assert_se(errno
== EAFNOSUPPORT
);
367 fd
= socket(AF_NETLINK
, SOCK_DGRAM
, 0);
373 assert_se(set_put(s
, INT_TO_PTR(AF_INET
)) >= 0);
375 assert_se(seccomp_restrict_address_families(s
, true) >= 0);
377 fd
= socket(AF_INET
, SOCK_DGRAM
, 0);
381 fd
= socket(AF_UNIX
, SOCK_DGRAM
, 0);
382 #if SECCOMP_RESTRICT_ADDRESS_FAMILIES_BROKEN
387 assert_se(errno
== EAFNOSUPPORT
);
390 fd
= socket(AF_NETLINK
, SOCK_DGRAM
, 0);
391 #if SECCOMP_RESTRICT_ADDRESS_FAMILIES_BROKEN
396 assert_se(errno
== EAFNOSUPPORT
);
402 assert_se(wait_for_terminate_and_check("socketseccomp", pid
, WAIT_LOG
) == EXIT_SUCCESS
);
405 static void test_restrict_realtime(void) {
408 log_info("/* %s */", __func__
);
410 if (!is_seccomp_available()) {
411 log_notice("Seccomp not available, skipping %s", __func__
);
414 if (geteuid() != 0) {
415 log_notice("Not root, skipping %s", __func__
);
419 /* in containers RT privs are likely missing anyway */
420 if (detect_container() > 0) {
421 log_notice("Testing in container, skipping %s", __func__
);
429 assert_se(sched_setscheduler(0, SCHED_FIFO
, &(struct sched_param
) { .sched_priority
= 1 }) >= 0);
430 assert_se(sched_setscheduler(0, SCHED_RR
, &(struct sched_param
) { .sched_priority
= 1 }) >= 0);
431 assert_se(sched_setscheduler(0, SCHED_IDLE
, &(struct sched_param
) { .sched_priority
= 0 }) >= 0);
432 assert_se(sched_setscheduler(0, SCHED_BATCH
, &(struct sched_param
) { .sched_priority
= 0 }) >= 0);
433 assert_se(sched_setscheduler(0, SCHED_OTHER
, &(struct sched_param
) {}) >= 0);
435 assert_se(seccomp_restrict_realtime() >= 0);
437 assert_se(sched_setscheduler(0, SCHED_IDLE
, &(struct sched_param
) { .sched_priority
= 0 }) >= 0);
438 assert_se(sched_setscheduler(0, SCHED_BATCH
, &(struct sched_param
) { .sched_priority
= 0 }) >= 0);
439 assert_se(sched_setscheduler(0, SCHED_OTHER
, &(struct sched_param
) {}) >= 0);
441 assert_se(sched_setscheduler(0, SCHED_FIFO
, &(struct sched_param
) { .sched_priority
= 1 }) < 0);
442 assert_se(errno
== EPERM
);
443 assert_se(sched_setscheduler(0, SCHED_RR
, &(struct sched_param
) { .sched_priority
= 1 }) < 0);
444 assert_se(errno
== EPERM
);
449 assert_se(wait_for_terminate_and_check("realtimeseccomp", pid
, WAIT_LOG
) == EXIT_SUCCESS
);
452 static void test_memory_deny_write_execute_mmap(void) {
455 log_info("/* %s */", __func__
);
457 if (!is_seccomp_available()) {
458 log_notice("Seccomp not available, skipping %s", __func__
);
461 if (geteuid() != 0) {
462 log_notice("Not root, skipping %s", __func__
);
472 p
= mmap(NULL
, page_size(), PROT_WRITE
|PROT_EXEC
, MAP_PRIVATE
|MAP_ANONYMOUS
, -1,0);
473 assert_se(p
!= MAP_FAILED
);
474 assert_se(munmap(p
, page_size()) >= 0);
476 p
= mmap(NULL
, page_size(), PROT_WRITE
|PROT_READ
, MAP_PRIVATE
|MAP_ANONYMOUS
, -1,0);
477 assert_se(p
!= MAP_FAILED
);
478 assert_se(munmap(p
, page_size()) >= 0);
480 assert_se(seccomp_memory_deny_write_execute() >= 0);
482 p
= mmap(NULL
, page_size(), PROT_WRITE
|PROT_EXEC
, MAP_PRIVATE
|MAP_ANONYMOUS
, -1,0);
483 #if defined(__x86_64__) || defined(__i386__) || defined(__powerpc64__) || defined(__arm__) || defined(__aarch64__)
484 assert_se(p
== MAP_FAILED
);
485 assert_se(errno
== EPERM
);
486 #else /* unknown architectures */
487 assert_se(p
!= MAP_FAILED
);
488 assert_se(munmap(p
, page_size()) >= 0);
491 p
= mmap(NULL
, page_size(), PROT_WRITE
|PROT_READ
, MAP_PRIVATE
|MAP_ANONYMOUS
, -1,0);
492 assert_se(p
!= MAP_FAILED
);
493 assert_se(munmap(p
, page_size()) >= 0);
498 assert_se(wait_for_terminate_and_check("memoryseccomp-mmap", pid
, WAIT_LOG
) == EXIT_SUCCESS
);
501 static void test_memory_deny_write_execute_shmat(void) {
505 log_info("/* %s */", __func__
);
507 if (!is_seccomp_available()) {
508 log_notice("Seccomp not available, skipping %s", __func__
);
511 if (geteuid() != 0) {
512 log_notice("Not root, skipping %s", __func__
);
516 shmid
= shmget(IPC_PRIVATE
, page_size(), 0);
517 assert_se(shmid
>= 0);
525 p
= shmat(shmid
, NULL
, 0);
526 assert_se(p
!= MAP_FAILED
);
527 assert_se(shmdt(p
) == 0);
529 p
= shmat(shmid
, NULL
, SHM_EXEC
);
530 assert_se(p
!= MAP_FAILED
);
531 assert_se(shmdt(p
) == 0);
533 assert_se(seccomp_memory_deny_write_execute() >= 0);
535 p
= shmat(shmid
, NULL
, SHM_EXEC
);
536 #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
537 assert_se(p
== MAP_FAILED
);
538 assert_se(errno
== EPERM
);
539 #else /* __i386__, __powerpc64__, and "unknown" architectures */
540 assert_se(p
!= MAP_FAILED
);
541 assert_se(shmdt(p
) == 0);
544 p
= shmat(shmid
, NULL
, 0);
545 assert_se(p
!= MAP_FAILED
);
546 assert_se(shmdt(p
) == 0);
551 assert_se(wait_for_terminate_and_check("memoryseccomp-shmat", pid
, WAIT_LOG
) == EXIT_SUCCESS
);
554 static void test_restrict_archs(void) {
557 log_info("/* %s */", __func__
);
559 if (!is_seccomp_available()) {
560 log_notice("Seccomp not available, skipping %s", __func__
);
563 if (geteuid() != 0) {
564 log_notice("Not root, skipping %s", __func__
);
572 _cleanup_set_free_ Set
*s
= NULL
;
574 assert_se(access("/", F_OK
) >= 0);
576 assert_se(s
= set_new(NULL
));
579 assert_se(set_put(s
, UINT32_TO_PTR(SCMP_ARCH_X86
+1)) >= 0);
581 assert_se(seccomp_restrict_archs(s
) >= 0);
583 assert_se(access("/", F_OK
) >= 0);
584 assert_se(seccomp_restrict_archs(NULL
) >= 0);
586 assert_se(access("/", F_OK
) >= 0);
591 assert_se(wait_for_terminate_and_check("archseccomp", pid
, WAIT_LOG
) == EXIT_SUCCESS
);
594 static void test_load_syscall_filter_set_raw(void) {
597 log_info("/* %s */", __func__
);
599 if (!is_seccomp_available()) {
600 log_notice("Seccomp not available, skipping %s", __func__
);
603 if (geteuid() != 0) {
604 log_notice("Not root, skipping %s", __func__
);
612 _cleanup_hashmap_free_ Hashmap
*s
= NULL
;
614 assert_se(access("/", F_OK
) >= 0);
615 assert_se(poll(NULL
, 0, 0) == 0);
617 assert_se(seccomp_load_syscall_filter_set_raw(SCMP_ACT_ALLOW
, NULL
, SCMP_ACT_KILL
, true) >= 0);
618 assert_se(access("/", F_OK
) >= 0);
619 assert_se(poll(NULL
, 0, 0) == 0);
621 assert_se(s
= hashmap_new(NULL
));
622 #if SCMP_SYS(access) >= 0
623 assert_se(hashmap_put(s
, UINT32_TO_PTR(__NR_access
+ 1), INT_TO_PTR(-1)) >= 0);
625 assert_se(hashmap_put(s
, UINT32_TO_PTR(__NR_faccessat
+ 1), INT_TO_PTR(-1)) >= 0);
628 assert_se(seccomp_load_syscall_filter_set_raw(SCMP_ACT_ALLOW
, s
, SCMP_ACT_ERRNO(EUCLEAN
), true) >= 0);
630 assert_se(access("/", F_OK
) < 0);
631 assert_se(errno
== EUCLEAN
);
633 assert_se(poll(NULL
, 0, 0) == 0);
637 assert_se(s
= hashmap_new(NULL
));
638 #if SCMP_SYS(access) >= 0
639 assert_se(hashmap_put(s
, UINT32_TO_PTR(__NR_access
+ 1), INT_TO_PTR(EILSEQ
)) >= 0);
641 assert_se(hashmap_put(s
, UINT32_TO_PTR(__NR_faccessat
+ 1), INT_TO_PTR(EILSEQ
)) >= 0);
644 assert_se(seccomp_load_syscall_filter_set_raw(SCMP_ACT_ALLOW
, s
, SCMP_ACT_ERRNO(EUCLEAN
), true) >= 0);
646 assert_se(access("/", F_OK
) < 0);
647 assert_se(errno
== EILSEQ
);
649 assert_se(poll(NULL
, 0, 0) == 0);
653 assert_se(s
= hashmap_new(NULL
));
654 #if SCMP_SYS(poll) >= 0
655 assert_se(hashmap_put(s
, UINT32_TO_PTR(__NR_poll
+ 1), INT_TO_PTR(-1)) >= 0);
657 assert_se(hashmap_put(s
, UINT32_TO_PTR(__NR_ppoll
+ 1), INT_TO_PTR(-1)) >= 0);
660 assert_se(seccomp_load_syscall_filter_set_raw(SCMP_ACT_ALLOW
, s
, SCMP_ACT_ERRNO(EUNATCH
), true) >= 0);
662 assert_se(access("/", F_OK
) < 0);
663 assert_se(errno
== EILSEQ
);
665 assert_se(poll(NULL
, 0, 0) < 0);
666 assert_se(errno
== EUNATCH
);
670 assert_se(s
= hashmap_new(NULL
));
671 #if SCMP_SYS(poll) >= 0
672 assert_se(hashmap_put(s
, UINT32_TO_PTR(__NR_poll
+ 1), INT_TO_PTR(EILSEQ
)) >= 0);
674 assert_se(hashmap_put(s
, UINT32_TO_PTR(__NR_ppoll
+ 1), INT_TO_PTR(EILSEQ
)) >= 0);
677 assert_se(seccomp_load_syscall_filter_set_raw(SCMP_ACT_ALLOW
, s
, SCMP_ACT_ERRNO(EUNATCH
), true) >= 0);
679 assert_se(access("/", F_OK
) < 0);
680 assert_se(errno
== EILSEQ
);
682 assert_se(poll(NULL
, 0, 0) < 0);
683 assert_se(errno
== EILSEQ
);
688 assert_se(wait_for_terminate_and_check("syscallrawseccomp", pid
, WAIT_LOG
) == EXIT_SUCCESS
);
691 static void test_lock_personality(void) {
692 unsigned long current
;
695 log_info("/* %s */", __func__
);
697 if (!is_seccomp_available()) {
698 log_notice("Seccomp not available, skipping %s", __func__
);
701 if (geteuid() != 0) {
702 log_notice("Not root, skipping %s", __func__
);
706 assert_se(opinionated_personality(¤t
) >= 0);
708 log_info("current personality=%lu", current
);
714 assert_se(seccomp_lock_personality(current
) >= 0);
716 assert_se((unsigned long) safe_personality(current
) == current
);
718 /* Note, we also test that safe_personality() works correctly, by checkig whether errno is properly
719 * set, in addition to the return value */
721 assert_se(safe_personality(PER_LINUX
| ADDR_NO_RANDOMIZE
) == -EPERM
);
722 assert_se(errno
== EPERM
);
724 assert_se(safe_personality(PER_LINUX
| MMAP_PAGE_ZERO
) == -EPERM
);
725 assert_se(safe_personality(PER_LINUX
| ADDR_COMPAT_LAYOUT
) == -EPERM
);
726 assert_se(safe_personality(PER_LINUX
| READ_IMPLIES_EXEC
) == -EPERM
);
727 assert_se(safe_personality(PER_LINUX_32BIT
) == -EPERM
);
728 assert_se(safe_personality(PER_SVR4
) == -EPERM
);
729 assert_se(safe_personality(PER_BSD
) == -EPERM
);
730 assert_se(safe_personality(current
== PER_LINUX
? PER_LINUX32
: PER_LINUX
) == -EPERM
);
731 assert_se(safe_personality(PER_LINUX32_3GB
) == -EPERM
);
732 assert_se(safe_personality(PER_UW7
) == -EPERM
);
733 assert_se(safe_personality(0x42) == -EPERM
);
735 assert_se(safe_personality(PERSONALITY_INVALID
) == -EPERM
); /* maybe remove this later */
737 assert_se((unsigned long) personality(current
) == current
);
741 assert_se(wait_for_terminate_and_check("lockpersonalityseccomp", pid
, WAIT_LOG
) == EXIT_SUCCESS
);
744 int main(int argc
, char *argv
[]) {
745 test_setup_logging(LOG_DEBUG
);
747 test_seccomp_arch_to_string();
748 test_architecture_table();
749 test_syscall_filter_set_find();
751 test_filter_sets_ordered();
752 test_restrict_namespace();
753 test_protect_sysctl();
754 test_restrict_address_families();
755 test_restrict_realtime();
756 test_memory_deny_write_execute_mmap();
757 test_memory_deny_write_execute_shmat();
758 test_restrict_archs();
759 test_load_syscall_filter_set_raw();
760 test_lock_personality();