Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a security preflight to detect when the benchmark process can open /proc/self/mem (commonly possible when running as root) and fails the benchmark unless explicitly opted in via a new allow_root flag. This tightens the isolation guarantees around the benchmark runner and updates the exploit test harness to expose the new option.
Changes:
- Plumb a new
allow_rootoption through the Python API into the native runner/manager. - Validate
/proc/self/memaccessibility during seccomp setup and error by default if it’s readable. - Improve
exploits/run_all.pyusability withargparseand forward sandbox options (including--allow-root).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| python/pygpubench/init.py | Adds allow_root to do_bench_isolated / _do_bench_impl and forwards it into _pygpubench.do_bench. |
| exploits/run_all.py | Adds CLI argument parsing and forwards sandbox/runner kwargs (including --allow-root). |
| csrc/manager.h | Extends make_benchmark_manager/constructor signatures and stores mAllowRoot. |
| csrc/manager.cpp | Wires mAllowRoot into install_seccomp_filter(mAllowRoot). |
| csrc/landlock.cpp | Implements /proc/self/mem readability validation and gates it on allow_root. |
| csrc/binding.cpp | Updates nanobind do_bench signature to accept supervisor_sock_fd earlier and add allow_root. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Check if /proc/self/mem is accessible. If so, error unless this behaviour has been explicitly opted in.