This repository was archived by the owner on Oct 15, 2026. It is now read-only.
Repository navigation
Don't use triton cache for CPU backend - #372
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Concurrent first launches can retain duplicate libraries, and fork-based workers can leave build artifacts behind.
2 open findings
What changed in this PR
Hardens CPU launcher loading by replacing Triton’s shared disk cache with private builds and process-local module reuse.
Changes:
- Builds launchers in private directories and validates artifact ownership, type, and permissions.
- Validates kernel names and removes Windows support.
- Registers cleanup for retained build directories.
| File | Description |
|---|---|
| backend/driver.py | Adds private launcher builds, artifact checks, process-local reuse, and cleanup. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Register launcher directory cleanup with multiprocessing so worker processes remove their private build artifacts on exit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Micah Weston (red1bluelost)
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Security scans reveal that
driver.pyof the CPU backend executes code from the disk without checks on ownership, permissions, signature, or hash. An attacker could thereby enable arbitrary code execution by priming the cache.Mitigation
Use ownership and permissions.
The CPU backend now builds and loads launchers from private temporary directories instead of reusing libraries from Triton’s shared disk cache. Generated artifacts are checked for ownership and file type, then made owner-read-only before loading; Windows support is removed to limit the burden of maintenance. Loaded modules are reused within each process, while a new process recompiles its launchers on first use.
Other changes
Another code injection vector is also mitigated.
launcher_src.replace(kernel_placeholder_name, kernel_name)potentially allows an attacker to usekernel_nameto inject code into the generated source before compilation. Mitigate by checking that the name looks like an identifier.