Skip to content

research: add ptrace compatibility results for Copilot coding-agent environment - #697

Closed
wan9chi with Copilot wants to merge 2 commits into
research/ptrace-strict-hosted-wsl-20260824from
copilot/run-ptrace-compatibility-experiment
Closed

research: add ptrace compatibility results for Copilot coding-agent environment#697
wan9chi with Copilot wants to merge 2 commits into
research/ptrace-strict-hosted-wsl-20260824from
copilot/run-ptrace-compatibility-experiment

Conversation

Copilot AI commented Aug 23, 2026

Copy link
Copy Markdown

Motivation

Verify that ptrace (attach, word I/O, process_vm_*, mmap injection via PTRACE_CONT) works correctly in the Copilot Coding Agent execution environment, and document the findings for the inject_demo / fspy development context.

Changes

  • research/copilot-coding-agent-ptrace-current-results.md — new report containing:
    • Commit SHA and source grep verification (required-summary, ptrace-word-io, ptrace::cont, patch_syscall_and_trap; confirmed no ptrace::step)
    • Full environment snapshot: kernel 6.17.0-1022-azure, Ubuntu 24.04.4, Azure VM (systemd-detect-virt: microsoft), uid=1001, CapEff=0, NoNewPrivs=0, Seccomp=0, Yama scope=1, no container
    • ptrace-environment-probe compile (exit 0) and run results: required-summary PASS, exit 0; ptrace-word-io PASS; process-vm-* PASS (tracked separately); three expected Yama-scope-1 relationship failures documented
    • rustup target add x86_64-unknown-none (the one permitted setup action; target was absent)
    • cargo run --locked -p inject_demo full output and exit 0; confirms PTRACE_CONT + syscall+trap patch path, not SINGLESTEP; payload mapped, SIGSYS interception active, child /bin/cat exited 0

Conclusion: ptrace is fully functional in this environment. All required checks pass.

Original prompt

Run a second, self-contained direct ptrace compatibility experiment in this GitHub Copilot coding-agent environment. The earlier attempt's injector build exited 101 only because the Rust target component was absent. This task explicitly permits the single ephemeral build-dependency action "rustup target add x86_64-unknown-none" if rustup target list --installed does not already show it. Do not use sudo or apt, install anything else, add capabilities, change seccomp/Yama, create credentials, or launch GitHub Actions. Do not edit product code or workflows.\n\nUse the ordinary agent user. Report git rev-parse HEAD and verify current source:\ngrep -nE 'required-summary|ptrace-word-io' research/ptrace-environment-probe.c\ngrep -nE 'ptrace::(cont|step)|patch_syscall_and_trap' crates/inject_demo/src/main.rs\nAbort if remote_mmap uses ptrace::step.\n\nCapture uname -a, /etc/os-release, id, CapEff/NoNewPrivs/Seccomp/Seccomp_filters, Yama value/read failure, both cgroup files, container marker presence, and systemd-detect-virt output/exit.\n\nCompile and run:\ngcc -O2 -Wall -Wextra -Werror research/ptrace-environment-probe.c -o /tmp/ptrace-environment-probe\nCapture compile exit, full output, and exact run exit. Required success needs both required-summary PASS and exit 0. Keep process_vm_* separate from required ptrace-word-io and distinguish expected relationship failures.\n\nBefore the injector, print rustup target list --installed. Only if missing, run:\nrustup target add x86_64-unknown-none\nCapture exact exit. Then run:\ncargo run --locked -p inject_demo\nCapture complete stdout/stderr and exact exit. Confirm this is PTRACE_CONT plus syscall+trap, not SINGLESTEP.\n\nWrite only research/copilot-coding-agent-ptrace-current-results.md with exact commands, relevant exact outputs/exits, commit SHA, direct Copilot execution identity, and the allowed one-component setup. Commit only that report. Preserve any blocker exactly and do not infer ptrace failure from build/setup errors.

Co-authored-by: Claude Sonnet 5 <claude-sonnet-5@anthropic.com>

Co-authored-by: wan9chi <3612422+wan9chi@users.noreply.github.com>
Copilot AI changed the title [WIP] Run second ptrace compatibility experiment with Rust target research: add ptrace compatibility results for Copilot coding-agent environment Aug 23, 2026
Copilot AI requested a review from wan9chi August 23, 2026 17:02
@wan9chi

wan9chi commented Aug 23, 2026

Copy link
Copy Markdown
Member

Experiment captured in the consolidated local research note; closing the temporary Copilot task PR. The shared strict base branch remains for reproduction.

@wan9chi wan9chi closed this Aug 23, 2026
@wan9chi
wan9chi deleted the copilot/run-ptrace-compatibility-experiment branch August 23, 2026 17:03
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