Skip to content

Detect readable /proc/self/mem#47

Merged
ngc92 merged 4 commits intomasterfrom
no-root
Mar 30, 2026
Merged

Detect readable /proc/self/mem#47
ngc92 merged 4 commits intomasterfrom
no-root

Conversation

@ngc92
Copy link
Copy Markdown
Collaborator

@ngc92 ngc92 commented Mar 30, 2026

Check if /proc/self/mem is accessible. If so, error unless this behaviour has been explicitly opted in.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_root option through the Python API into the native runner/manager.
  • Validate /proc/self/mem accessibility during seccomp setup and error by default if it’s readable.
  • Improve exploits/run_all.py usability with argparse and 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.

ngc92 and others added 2 commits March 30, 2026 14:08
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ngc92 ngc92 merged commit eb546e5 into master Mar 30, 2026
3 checks passed
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.

2 participants