The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2 0/2] seccomp: Fix a race with WAIT_KILLABLE_RECV if the tracer replies too fast
@ 2025-07-25 16:31 Johannes Nixdorf
  2025-07-25 16:31 ` [PATCH v2 1/2] " Johannes Nixdorf
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Johannes Nixdorf @ 2025-07-25 16:31 UTC (permalink / raw)
  To: Kees Cook, Andy Lutomirski, Will Drewry, Sargun Dhillon,
	Shuah Khan
  Cc: linux-kernel, Ali Polatel, linux-kselftest, bpf, Johannes Nixdorf

If WAIT_KILLABLE_RECV was specified, and an event is received, the
tracee's syscall is not supposed to be interruptible. This was not properly
ensured if the reply was sent too fast, and an interrupting signal was
received before the reply was processed on the tracee side.

This series fixes the bug and adds a test case for it to the selftests.

Signed-off-by: Johannes Nixdorf <johannes@nixdorf.dev>
---
Changes in v2:
- Added a selftest for the bug.
- Link to v1: https://lore.kernel.org/r/20250723-seccomp-races-v1-1-bef5667ce30a@nixdorf.dev

---
Johannes Nixdorf (2):
      seccomp: Fix a race with WAIT_KILLABLE_RECV if the tracer replies too fast
      selftests/seccomp: Add a test for the WAIT_KILLABLE_RECV fast reply race

 kernel/seccomp.c                              |  13 ++-
 tools/testing/selftests/seccomp/seccomp_bpf.c | 130 ++++++++++++++++++++++++++
 2 files changed, 136 insertions(+), 7 deletions(-)
---
base-commit: 89be9a83ccf1f88522317ce02f854f30d6115c41
change-id: 20250721-seccomp-races-e97897d6d94b

Best regards,
-- 
Johannes Nixdorf <johannes@nixdorf.dev>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-07-29 20:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox