1From e45a80f8628f60be23c2a8e0b1418c69b0835015 Mon Sep 17 00:00:00 2001
2From: Edward Liaw <[email protected]>
3Date: Fri, 6 Oct 2023 18:46:00 +0000
4Subject: [PATCH] seccomp_bpf: Disable incompatible tests
5
6Bug: 147676645
7Test: atest vts_linux_kselftest_x86_64:seccomp_seccomp_bpf_x86_64
8Test: atest vts_linux_kselftest_arm_64:seccomp_seccomp_bpf_arm_64
9Signed-off-by: Edward Liaw <[email protected]>
10---
11 tools/testing/selftests/seccomp/seccomp_bpf.c | 32 +++++++++++++++++++
12 1 file changed, 32 insertions(+)
13
14diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
15index 110ca8bf8e2b..953876b81793 100644
16--- a/tools/testing/selftests/seccomp/seccomp_bpf.c
17+++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
18@@ -4488,6 +4488,13 @@ static char get_proc_stat(struct __test_metadata *_metadata, pid_t pid)
19 	return status;
20 }
21
22+/*
23+ * b/147676645
24+ * SECCOMP_IOCTL_NOTIF_RECV not compatible < 5.0
25+ * SECCOMP_IOCTL_NOTIF_SEND not compatible < 5.0
26+ * SECCOMP_FILTER_FLAG_NEW_LISTENER not compatible < 5.0
27+ */
28+#ifndef __ANDROID__
29 TEST(user_notification_fifo)
30 {
31 	struct seccomp_notif_resp resp = {};
32@@ -4566,6 +4573,7 @@ restart_wait:
33 		EXPECT_EQ(0, WEXITSTATUS(status));
34 	}
35 }
36+#endif
37
38 /* get_proc_syscall - Get the syscall in progress for a given pid
39  *
40@@ -4590,6 +4598,12 @@ static long get_proc_syscall(struct __test_metadata *_metadata, int pid)
41 	return ret;
42 }
43
44+/*
45+ * b/147676645
46+ * SECCOMP_FILTER_FLAG_NEW_LISTENER not compatible < 5.0
47+ * SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV not compatible < 5.19
48+ */
49+#ifndef __ANDROID__
50 /* Ensure non-fatal signals prior to receive are unmodified */
51 TEST(user_notification_wait_killable_pre_notification)
52 {
53@@ -4659,7 +4673,16 @@ TEST(user_notification_wait_killable_pre_notification)
54
55 	EXPECT_EQ(read(sk_pair[0], &c, 1), 1);
56 }
57+#endif
58
59+/*
60+ * b/147676645
61+ * SECCOMP_IOCTL_NOTIF_RECV not compatible < 5.0
62+ * SECCOMP_IOCTL_NOTIF_SEND not compatible < 5.0
63+ * SECCOMP_FILTER_FLAG_NEW_LISTENER not compatible < 5.0
64+ * SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV not compatible < 5.19
65+ */
66+#ifndef __ANDROID__
67 /* Ensure non-fatal signals after receive are blocked */
68 TEST(user_notification_wait_killable)
69 {
70@@ -4738,7 +4761,15 @@ TEST(user_notification_wait_killable)
71 	EXPECT_EQ(true, WIFEXITED(status));
72 	EXPECT_EQ(0, WEXITSTATUS(status));
73 }
74+#endif
75
76+/*
77+ * b/147676645
78+ * SECCOMP_IOCTL_NOTIF_RECV not compatible < 5.0
79+ * SECCOMP_FILTER_FLAG_NEW_LISTENER not compatible < 5.0
80+ * SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV not compatible < 5.19
81+ */
82+#ifndef __ANDROID__
83 /* Ensure fatal signals after receive are not blocked */
84 TEST(user_notification_wait_killable_fatal)
85 {
86@@ -4788,6 +4819,7 @@ TEST(user_notification_wait_killable_fatal)
87 	EXPECT_EQ(true, WIFSIGNALED(status));
88 	EXPECT_EQ(SIGTERM, WTERMSIG(status));
89 }
90+#endif
91
92 /*
93  * TODO:
94--
952.42.0.609.gbb76f46606-goog
96
97