Re: [PATCH v2 2/2] selftests/seccomp: Add a test for the WAIT_KILLABLE_RECV fast reply race
From: Kees Cook
Date: Mon Jul 28 2025 - 21:07:54 EST
On Fri, Jul 25, 2025 at 06:31:19PM +0200, Johannes Nixdorf wrote:
> + struct itimerval timer = {
> + .it_value = { .tv_usec = 1000 },
> + .it_interval = { .tv_usec = 1000 },
> + };
To get this to build, I needed to add a sys/time.h include:
diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
index b24d0cbe88b4..fc4910d35342 100644
--- a/tools/testing/selftests/seccomp/seccomp_bpf.c
+++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
@@ -24,6 +24,7 @@
#include <linux/filter.h>
#include <sys/prctl.h>
#include <sys/ptrace.h>
+#include <sys/time.h>
#include <sys/user.h>
#include <linux/prctl.h>
#include <linux/ptrace.h>
But, with that, yes, I can confirm the race and the fix. Thank you!
I can fix that up locally.
-Kees
--
Kees Cook