The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: Johannes Nixdorf <johannes@nixdorf.dev>
Cc: Andy Lutomirski <luto@amacapital.net>,
	Will Drewry <wad@chromium.org>, Sargun Dhillon <sargun@sargun.me>,
	Shuah Khan <shuah@kernel.org>,
	linux-kernel@vger.kernel.org, Ali Polatel <alip@chesswob.org>,
	linux-kselftest@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH v2 2/2] selftests/seccomp: Add a test for the WAIT_KILLABLE_RECV fast reply race
Date: Mon, 28 Jul 2025 18:07:42 -0700	[thread overview]
Message-ID: <202507281805.14457D3EAF@keescook> (raw)
In-Reply-To: <20250725-seccomp-races-v2-2-cf8b9d139596@nixdorf.dev>

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

  reply	other threads:[~2025-07-29  1:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-25 16:31 [PATCH v2 0/2] seccomp: Fix a race with WAIT_KILLABLE_RECV if the tracer replies too fast Johannes Nixdorf
2025-07-25 16:31 ` [PATCH v2 1/2] " Johannes Nixdorf
2025-07-25 16:31 ` [PATCH v2 2/2] selftests/seccomp: Add a test for the WAIT_KILLABLE_RECV fast reply race Johannes Nixdorf
2025-07-29  1:07   ` Kees Cook [this message]
2025-07-29 16:45     ` Johannes Nixdorf
2025-07-29 20:34 ` [PATCH v2 0/2] seccomp: Fix a race with WAIT_KILLABLE_RECV if the tracer replies too fast Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202507281805.14457D3EAF@keescook \
    --to=kees@kernel.org \
    --cc=alip@chesswob.org \
    --cc=bpf@vger.kernel.org \
    --cc=johannes@nixdorf.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=sargun@sargun.me \
    --cc=shuah@kernel.org \
    --cc=wad@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox