Skip to content

Fix race condition in SecCompDispatcher startup - #42201

Merged
Blue (OneBlue) merged 2 commits into
masterfrom
user/oneblue/fix-race-47
Nov 6, 2026
Merged

Blue (OneBlue) merged 2 commits into
masterfrom
user/oneblue/fix-race-47

Conversation

@OneBlue

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

This change solves a race conditions during SecCompDispatcher's startup: If a syscall is received before / while handlers are still being registered m_handlers can be accessed concurrently, and notifications can be missed.

This change solves the issue by having a separate Start() method that's called after all handlers are registered and removing the unused method to unregister callbacks

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

@OneBlue
Blue (OneBlue) requested a review from a team as a code owner November 6, 2026 18:18
Copilot AI balanced review requested due to automatic review settings November 6, 2026 18:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the seccomp dispatcher startup-race fix.

No open issues 🎉

What changed in this PR

Fixes a startup race in the Linux seccomp dispatcher by delaying notification processing until all handlers are registered.

Changes:

  • Adds an explicit Start() method and calls it before running the port tracker.
  • Initializes the shutdown pipe before launching the worker and safely handles destruction without startup.
  • Removes unused handler unregistration and adds assertions against registration after startup.
File Description
src/​linux/​init/​SecCompDispatcher.h Declares explicit startup and updates the worker interface.
src/​linux/​init/​SecCompDispatcher.cpp Separates construction from startup and adjusts shutdown handling.
src/​linux/​init/​localhost.cpp Starts the dispatcher after handler registration, before the port tracker runs.

Review effort: Balanced

@OneBlue
Blue (OneBlue) merged commit 19cd15e into master Nov 6, 2026
17 checks passed
@OneBlue
Blue (OneBlue) deleted the user/oneblue/fix-race-47 branch November 6, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants