1 diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c 2 index 34d9582aefb4..843ba80c401b 100644 3 --- a/tools/testing/selftests/seccomp/seccomp_bpf.c 4 +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c 5 @@ -12,12 +12,14 @@ 6 * we need to use the kernel's siginfo.h file and trick glibc 7 * into accepting it. 8 */ 9 +#if defined(__GLIBC_PREREQ) 10 #if !__GLIBC_PREREQ(2, 26) 11 # include <asm/siginfo.h> 12 # define __have_siginfo_t 1 13 # define __have_sigval_t 1 14 # define __have_sigevent_t 1 15 #endif 16 +#endif 17 18 #include <errno.h> 19 #include <linux/filter.h> 20 @@ -404,6 +406,7 @@ TEST(empty_prog) 21 EXPECT_EQ(EINVAL, errno); 22 } 23 24 +#if 0 25 TEST(log_all) 26 { 27 struct sock_filter filter[] = { 28 @@ -425,6 +428,7 @@ TEST(log_all) 29 /* getppid() should succeed and be logged (no check for logging) */ 30 EXPECT_EQ(parent, syscall(__NR_getppid)); 31 } 32 +#endif 33 34 TEST_SIGNAL(unknown_ret_is_kill_inside, SIGSYS) 35 { 36 @@ -677,6 +681,7 @@ void kill_thread_or_group(struct __test_metadata *_metadata, bool kill_process) 37 exit(42); 38 } 39 40 +#if 0 41 TEST(KILL_thread) 42 { 43 int status; 44 @@ -695,6 +700,7 @@ TEST(KILL_thread) 45 ASSERT_TRUE(WIFEXITED(status)); 46 ASSERT_EQ(42, WEXITSTATUS(status)); 47 } 48 +#endif 49 50 TEST(KILL_process) 51 { 52 @@ -1242,6 +1248,7 @@ TEST_F(precedence, trace_is_fourth_in_any_order) 53 EXPECT_EQ(-1, syscall(__NR_getpid)); 54 } 55 56 +#if 0 57 TEST_F(precedence, log_is_fifth) 58 { 59 pid_t mypid, parent; 60 @@ -1281,6 +1288,7 @@ TEST_F(precedence, log_is_fifth_in_any_order) 61 /* Should also work just fine */ 62 EXPECT_EQ(mypid, syscall(__NR_getpid)); 63 } 64 +#endif 65 66 #ifndef PTRACE_O_TRACESECCOMP 67 #define PTRACE_O_TRACESECCOMP 0x00000080 68 @@ -1717,8 +1725,10 @@ void tracer_ptrace(struct __test_metadata *_metadata, pid_t tracee, 69 70 if (nr == __NR_getpid) 71 change_syscall(_metadata, tracee, __NR_getppid); 72 +#ifdef __NR_open 73 if (nr == __NR_open) 74 change_syscall(_metadata, tracee, -1); 75 +#endif 76 } 77 78 FIXTURE_DATA(TRACE_syscall) { 79 @@ -1784,6 +1794,7 @@ TEST_F(TRACE_syscall, ptrace_syscall_redirected) 80 EXPECT_NE(self->mypid, syscall(__NR_getpid)); 81 } 82 83 +#ifdef __NR_open 84 TEST_F(TRACE_syscall, ptrace_syscall_dropped) 85 { 86 /* Swap SECCOMP_RET_TRACE tracer for PTRACE_SYSCALL tracer. */ 87 @@ -1794,6 +1805,7 @@ TEST_F(TRACE_syscall, ptrace_syscall_dropped) 88 /* Tracer should skip the open syscall, resulting in EPERM. */ 89 EXPECT_SYSCALL_RETURN(EPERM, syscall(__NR_open)); 90 } 91 +#endif 92 93 TEST_F(TRACE_syscall, syscall_allowed) 94 { 95 @@ -2059,6 +2071,7 @@ TEST(seccomp_syscall_mode_lock) 96 } 97 } 98 99 +#if 0 100 /* 101 * Test detection of known and unknown filter flags. Userspace needs to be able 102 * to check if a filter flag is supported by the current kernel and a good way 103 @@ -2119,6 +2132,7 @@ TEST(detect_seccomp_filter_flags) 104 flag); 105 } 106 } 107 +#endif 108 109 TEST(TSYNC_first) 110 { 111 @@ -2759,6 +2773,7 @@ TEST(syscall_restart) 112 _metadata->passed = 0; 113 } 114 115 +#if 0 116 TEST_SIGNAL(filter_flag_log, SIGSYS) 117 { 118 struct sock_filter allow_filter[] = { 119 @@ -2851,6 +2866,7 @@ TEST(get_action_avail) 120 EXPECT_EQ(ret, -1); 121 EXPECT_EQ(errno, EOPNOTSUPP); 122 } 123 +#endif 124 125 /* 126 * TODO: 127