Skip to content

Commit 2aa8d8d

Browse files
Christian Braunerkees
authored andcommitted
seccomp: fix SECCOMP_USER_NOTIF_FLAG_CONTINUE test
The ifndef for SECCOMP_USER_NOTIF_FLAG_CONTINUE was placed under the ifndef for the SECCOMP_FILTER_FLAG_NEW_LISTENER feature. This will not work on systems that do support SECCOMP_FILTER_FLAG_NEW_LISTENER but do not support SECCOMP_USER_NOTIF_FLAG_CONTINUE. So move the latter ifndef out of the former ifndef's scope. 2019-10-20 11:14:01 make run_tests -C seccomp make: Entering directory '/usr/src/perf_selftests-x86_64-rhel-7.6-0eebfed2954f152259cae0ad57b91d3ea92968e8/tools/testing/selftests/seccomp' gcc -Wl,-no-as-needed -Wall seccomp_bpf.c -lpthread -o seccomp_bpf seccomp_bpf.c: In function ‘user_notification_continue’: seccomp_bpf.c:3562:15: error: ‘SECCOMP_USER_NOTIF_FLAG_CONTINUE’ undeclared (first use in this function) resp.flags = SECCOMP_USER_NOTIF_FLAG_CONTINUE; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ seccomp_bpf.c:3562:15: note: each undeclared identifier is reported only once for each function it appears in Makefile:12: recipe for target 'seccomp_bpf' failed make: *** [seccomp_bpf] Error 1 make: Leaving directory '/usr/src/perf_selftests-x86_64-rhel-7.6-0eebfed2954f152259cae0ad57b91d3ea92968e8/tools/testing/selftests/seccomp' Reported-by: kernel test robot <[email protected]> Fixes: 0eebfed ("seccomp: test SECCOMP_USER_NOTIF_FLAG_CONTINUE") Cc: [email protected] Signed-off-by: Christian Brauner <[email protected]> Reviewed-by: Tycho Andersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>
1 parent fefad9e commit 2aa8d8d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/testing/selftests/seccomp/seccomp_bpf.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,6 @@ struct seccomp_metadata {
168168

169169
#define SECCOMP_RET_USER_NOTIF 0x7fc00000U
170170

171-
#ifndef SECCOMP_USER_NOTIF_FLAG_CONTINUE
172-
#define SECCOMP_USER_NOTIF_FLAG_CONTINUE 0x00000001
173-
#endif
174-
175171
#define SECCOMP_IOC_MAGIC '!'
176172
#define SECCOMP_IO(nr) _IO(SECCOMP_IOC_MAGIC, nr)
177173
#define SECCOMP_IOR(nr, type) _IOR(SECCOMP_IOC_MAGIC, nr, type)
@@ -210,6 +206,10 @@ struct seccomp_notif_sizes {
210206
#define PTRACE_EVENTMSG_SYSCALL_EXIT 2
211207
#endif
212208

209+
#ifndef SECCOMP_USER_NOTIF_FLAG_CONTINUE
210+
#define SECCOMP_USER_NOTIF_FLAG_CONTINUE 0x00000001
211+
#endif
212+
213213
#ifndef seccomp
214214
int seccomp(unsigned int op, unsigned int flags, void *args)
215215
{

0 commit comments

Comments
 (0)