feat(libkernel_sys): implement _execve and _execvpe exports #14299

Merged
bipinkrish merged 9 commits from upstream-pr/14299 into main 2026-11-05 16:08:27 +00:00
bipinkrish commented 2026-11-01 07:22:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by bipinkrish on 2026-11-01T07:22:43Z.


What

Implement _execve and _execvpe with checked guest argument copying, FreeBSD-style validation and PATH search. Recognized ELF/SELF candidates now call libkernel's existing execve replacement path with copied argument and environment vectors, so they can launch a converted executable.

_execvpe retains FreeBSD 11.4's per-candidate errno handling and ENOEXEC retry through /bin/sh. Its name read is bounded to 1024 bytes; oversized names end with the search's ENOENT. The search uses guest PATH, independently of the replacement's explicit environment. See execvPe and kernel exec_copyin_args / exec_check_permissions.

Review fixes make the shared helper private, use NotImplemented_nid_no_patch for unsupported script and null-path execution, remove exact exception-message assertions, and add process-replacement fixtures for both exports. Keeping the FreeBSD candidate loop avoids changing libkernel's existing first-match execvp search behavior.

The debt entries now state remaining gaps first and inherit converted-target restrictions from libkernel. Corrected the pending inventory to 323 exports: 163 named and 160 unresolved. Console behavior is unverified. Land after #14257, then reconcile its independently updated inventory counts when rebasing; #14304 follows this PR.

A null pathname in _execve remains unsupported: FreeBSD 11.4's do_execve selects descriptor-based execution there, which this implementation does not model. Equivalence to libkernel execve's separately measured null-path EBADF is unverified. _execvpe checks a null search name before candidate execution and returns EFAULT as a checked-read fallback.

Both exports inherit libkernel's environment merge: host environ entries survive unless envp overrides their names. The supplied environment does not completely replace the inherited one; this limitation is explicit in the debt entry.

Tested

  • Ubuntu 24.04.4 x86-64, GCC 13, Release, current main e67cc81869: built both errno test executables, guest_exec_host, and relinker.
  • ctest --test-dir build -R '^(guest_kernel_sys_exec(ve|vpe)|exec_arguments|exec_sys_(ve|vpe)_arguments)$' --output-on-failure: 5/5 passed outside the syscall-restricted sandbox. The two new process fixtures verify actual image replacement, arguments, explicit environment, working directory, PID behavior and absence of exit-handler execution. The errno tests cover invalid guest reads, path and argument limits, access errors, default/guest/empty PATH, and shell fallback. Search fixtures now use a unique temporary directory.
  • Public-header audit, diff and convention/template checks passed. The helper is absent from the shared library's dynamic exports. Debt table recounted: 323 = 163 named + 160 unresolved; both new debt bullets are below 1000 characters.
  • Runtime results above are from 399bb8f19a; the subsequent null-path and environment clarification changes documentation only.
  • No console run or local Windows run. Existing Windows CI evidence predates these review fixes; a fresh hosted run is still needed.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #14257
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5105332788 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14299). Originally posted by [bipinkrish](https://github.com/bipinkrish) on 2026-11-01T07:22:43Z. --- ### What Implement `_execve` and `_execvpe` with checked guest argument copying, FreeBSD-style validation and `PATH` search. Recognized ELF/SELF candidates now call libkernel's existing `execve` replacement path with copied argument and environment vectors, so they can launch a converted executable. `_execvpe` retains FreeBSD 11.4's per-candidate errno handling and `ENOEXEC` retry through `/bin/sh`. Its name read is bounded to 1024 bytes; oversized names end with the search's `ENOENT`. The search uses guest `PATH`, independently of the replacement's explicit environment. See [`execvPe`](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/lib/libc/gen/exec.c#L145-L281) and kernel [`exec_copyin_args` / `exec_check_permissions`](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/sys/kern/kern_exec.c#L1172-L1680). Review fixes make the shared helper private, use `NotImplemented_nid_no_patch` for unsupported script and null-path execution, remove exact exception-message assertions, and add process-replacement fixtures for both exports. Keeping the FreeBSD candidate loop avoids changing libkernel's existing first-match `execvp` search behavior. The debt entries now state remaining gaps first and inherit converted-target restrictions from libkernel. Corrected the pending inventory to 323 exports: 163 named and 160 unresolved. Console behavior is unverified. Land after #14257, then reconcile its independently updated inventory counts when rebasing; #14304 follows this PR. A null pathname in `_execve` remains unsupported: FreeBSD 11.4's [`do_execve`](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/sys/kern/kern_exec.c#L433-L465) selects descriptor-based execution there, which this implementation does not model. Equivalence to libkernel `execve`'s separately measured null-path `EBADF` is unverified. `_execvpe` checks a null search name before candidate execution and returns `EFAULT` as a checked-read fallback. Both exports inherit libkernel's environment merge: host `environ` entries survive unless `envp` overrides their names. The supplied environment does not completely replace the inherited one; this limitation is explicit in the debt entry. ### Tested - Ubuntu 24.04.4 x86-64, GCC 13, Release, current `main` `e67cc81869`: built both errno test executables, `guest_exec_host`, and `relinker`. - `ctest --test-dir build -R '^(guest_kernel_sys_exec(ve|vpe)|exec_arguments|exec_sys_(ve|vpe)_arguments)$' --output-on-failure`: 5/5 passed outside the syscall-restricted sandbox. The two new process fixtures verify actual image replacement, arguments, explicit environment, working directory, PID behavior and absence of exit-handler execution. The errno tests cover invalid guest reads, path and argument limits, access errors, default/guest/empty `PATH`, and shell fallback. Search fixtures now use a unique temporary directory. - Public-header audit, diff and convention/template checks passed. The helper is absent from the shared library's dynamic exports. Debt table recounted: 323 = 163 named + 160 unresolved; both new debt bullets are below 1000 characters. - Runtime results above are from `399bb8f19a`; the subsequent null-path and environment clarification changes documentation only. - No console run or local Windows run. Existing Windows CI evidence predates these review fixes; a fresh hosted run is still needed. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #14257 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-01 09:03:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T09:03:00Z.

Review: COMMENTED


Reviewed — no blocking findings

The two new tests pass on hosted Windows at this head and the errno ladders match the PR body in source reading; the open points below are non-blocking, the main one being that the existing libkernel execve already replaces the process for ELF images.

What I ran

Exact head reviewed: a37dcc1320fb22da78e9afe2744334cb0dac66aa (commits cf77fa4bcc, _execve, and a37dcc1320, _execvpe). PR base 3e29acc3805f15e19a0c8f55eedb0c93e92f2f90. Merge preview against current main c674f8c14da93df7a6b37657117ca3f58357477f: clean (git merge-tree --write-tree, exit 0, no conflicts).

Environment: Debian host, git 2.39.5, system Python 3. No build, no compile, no local test run. The checks were run from the trusted checkout /marc/AnyPS5/tools against the PR's git objects; the PR's own tools and tests were not executed.

git diff --check 3e29acc3805f15e19a0c8f55eedb0c93e92f2f90 a37dcc1320fb22da78e9afe2744334cb0dac66aa
python3 tools/check_conventions.py --base 3e29acc3805f15e19a0c8f55eedb0c93e92f2f90 --head a37dcc1320fb22da78e9afe2744334cb0dac66aa --title '<PR title>' --body <PR body file>
python3 tools/pr_abi_audit.py --base 3e29acc3805f15e19a0c8f55eedb0c93e92f2f90 --head a37dcc1320fb22da78e9afe2744334cb0dac66aa --json
python3 tools/pr_test_quality.py --root <git archive of a37dcc13: the two new test files and core/libs/CMakeLists.txt> --json core/libs/tests/GuestKernelSysExecve.cpp core/libs/tests/GuestKernelSysExecvpe.cpp
git merge-tree --write-tree --name-only c674f8c14da93df7a6b37657117ca3f58357477f a37dcc1320fb22da78e9afe2744334cb0dac66aa

The pr_precheck.py wrapper was not run for this head, for the same reason as the review of #14096: its isolated checkout would execute PR-head tooling and tests.

Results

Check Result
git diff --check over the PR range Passed (exit 0)
Repository conventions and PR body Passed
Export/declaration audit (pr_abi_audit.py, by hand) Passed: status passed, 325 symbols, 0 findings; lexical only
Test-quality heuristic (pr_test_quality.py) Two possible-unregistered-cpp-test findings, false positives: the CMake path is relative (tests/...); registration is explicit at core/libs/CMakeLists.txt L505-L519
Current-main merge preview Clean
Hosted Windows, Build run 41284550676, job 124783770803 Success; guest_kernel_sys_execve and guest_kernel_sys_execvpe Passed; 2581 of 2581 tests passed
Hosted eligibility, conventions (rerun), labels, report, library-portability Success
Hosted Linux, relinker, relinker-asan, register-context, write-watch Skipped
Unedited hosted log lines (Windows job)
2026-11-01T07:40:40.4735848Z   41/2581 Test  #452: guest_kernel_sys_execvpe .................................................   Passed    0.07 sec
2026-11-01T07:40:40.4965599Z   42/2581 Test  #451: guest_kernel_sys_execve ..................................................   Passed    0.12 sec
2026-11-01T07:42:54.3607098Z 100% tests passed, 0 tests failed out of 2581

Findings

Blocking: none.

Non-blocking:

  1. Relation to the existing execve. In libkernel, execve, execv and execvp already replace the process for ELF images through ExecProgram, which calls fexecve on Linux (Process.cpp L842-L892 at main). The new _execve and _execvpe refuse the same images with "program activation is not modelled" (AdditionalExports.cpp L295 at the head). The PR body lists this as a follow-up, but the head has no such commit. Either route the libkernel_sys exports through the same activation, or say in the debt bullet why they refuse what execve performs.
  2. Refusals throw a custom std::runtime_error, not NotImplemented_nid_no_patch, so NotImplementedCalls_nid_no_patch does not count them (General.cpp L1020-L1023 at main). The PR checklist says unimplemented paths throw through NotImplemented_nid_no_patch. Use it, or note the deviation in the debt bullet.
  3. _execvpe reads the name with no length cap; the loop ends only at a NUL or an unreadable page (AdditionalExports.cpp L326-L338 at the head). _execve caps its path at 1024 bytes. A cap would bound host allocation for hostile names.
  4. The points raised on closed #14275 (the relation to execve, exact-message asserts in the tests, and the debt bullet length) are not yet in the head. The _execve debt bullet is exactly 1000 characters, which is not over the debt-length warning threshold in tools/check_conventions.py.

Sources

Not verified

  • No build and no local run of the two tests. The only test evidence is the hosted Windows job at this head; hosted Linux was skipped.
  • The Linux-only branches (#ifndef _WIN32 EACCES cases and the Linux permission path) rest on the author's report of a local Linux build and ctest -R 'guest_kernel_sys' (28/28); not run here.
  • The errno ladders were not re-derived from the cited FreeBSD 11.4 sources. For example, whether _execvpe maps ENAMETOOLONG for a slash-containing name longer than 1024 bytes to ENOENT was not checked against FreeBSD.
  • The overlap with #14257, which also edits AdditionalExports.cpp, its header and the libkernel_sys debt file, was not resolved here. The PR's merge preview against current main is clean.
  • Console behavior of ELF and SELF acceptance is not verified, as the author notes.
  • No negative control was exercised.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5727067418 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14299#pullrequestreview-5727067418). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T09:03:00Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The two new tests pass on hosted Windows at this head and the errno ladders match the PR body in source reading; the open points below are non-blocking, the main one being that the existing libkernel `execve` already replaces the process for ELF images. ## What I ran Exact head reviewed: `a37dcc1320fb22da78e9afe2744334cb0dac66aa` (commits `cf77fa4bcc`, `_execve`, and `a37dcc1320`, `_execvpe`). PR base `3e29acc3805f15e19a0c8f55eedb0c93e92f2f90`. Merge preview against current `main` `c674f8c14da93df7a6b37657117ca3f58357477f`: clean (`git merge-tree --write-tree`, exit 0, no conflicts). Environment: Debian host, git 2.39.5, system Python 3. No build, no compile, no local test run. The checks were run from the trusted checkout `/marc/AnyPS5/tools` against the PR's git objects; the PR's own tools and tests were not executed. ```sh git diff --check 3e29acc3805f15e19a0c8f55eedb0c93e92f2f90 a37dcc1320fb22da78e9afe2744334cb0dac66aa python3 tools/check_conventions.py --base 3e29acc3805f15e19a0c8f55eedb0c93e92f2f90 --head a37dcc1320fb22da78e9afe2744334cb0dac66aa --title '<PR title>' --body <PR body file> python3 tools/pr_abi_audit.py --base 3e29acc3805f15e19a0c8f55eedb0c93e92f2f90 --head a37dcc1320fb22da78e9afe2744334cb0dac66aa --json python3 tools/pr_test_quality.py --root <git archive of a37dcc13: the two new test files and core/libs/CMakeLists.txt> --json core/libs/tests/GuestKernelSysExecve.cpp core/libs/tests/GuestKernelSysExecvpe.cpp git merge-tree --write-tree --name-only c674f8c14da93df7a6b37657117ca3f58357477f a37dcc1320fb22da78e9afe2744334cb0dac66aa ``` The `pr_precheck.py` wrapper was not run for this head, for the same reason as the review of #14096: its isolated checkout would execute PR-head tooling and tests. ## Results | Check | Result | |---|---| | `git diff --check` over the PR range | Passed (exit 0) | | Repository conventions and PR body | Passed | | Export/declaration audit (`pr_abi_audit.py`, by hand) | Passed: status `passed`, 325 symbols, 0 findings; lexical only | | Test-quality heuristic (`pr_test_quality.py`) | Two `possible-unregistered-cpp-test` findings, false positives: the CMake path is relative (`tests/...`); registration is explicit at `core/libs/CMakeLists.txt` L505-L519 | | Current-main merge preview | Clean | | Hosted Windows, `Build` run 41284550676, job 124783770803 | Success; `guest_kernel_sys_execve` and `guest_kernel_sys_execvpe` Passed; 2581 of 2581 tests passed | | Hosted eligibility, conventions (rerun), labels, report, library-portability | Success | | Hosted Linux, relinker, relinker-asan, register-context, write-watch | Skipped | <details><summary>Unedited hosted log lines (Windows job)</summary> ```text 2026-11-01T07:40:40.4735848Z 41/2581 Test #452: guest_kernel_sys_execvpe ................................................. Passed 0.07 sec 2026-11-01T07:40:40.4965599Z 42/2581 Test #451: guest_kernel_sys_execve .................................................. Passed 0.12 sec 2026-11-01T07:42:54.3607098Z 100% tests passed, 0 tests failed out of 2581 ``` </details> ## Findings **Blocking:** none. **Non-blocking:** 1. Relation to the existing `execve`. In libkernel, `execve`, `execv` and `execvp` already replace the process for ELF images through `ExecProgram`, which calls `fexecve` on Linux ([Process.cpp L842-L892 at `main`](https://github.com/boykopovar/AnyPS5/blob/c674f8c14da93df7a6b37657117ca3f58357477f/core/libs/prx/libkernel/System/src/Process.cpp#L842-L892)). The new `_execve` and `_execvpe` refuse the same images with "program activation is not modelled" ([AdditionalExports.cpp L295 at the head](https://github.com/boykopovar/AnyPS5/blob/a37dcc1320fb22da78e9afe2744334cb0dac66aa/core/libs/prx/libkernel_sys/AdditionalExports.cpp#L295)). The PR body lists this as a follow-up, but the head has no such commit. Either route the libkernel_sys exports through the same activation, or say in the debt bullet why they refuse what `execve` performs. 2. Refusals throw a custom `std::runtime_error`, not `NotImplemented_nid_no_patch`, so `NotImplementedCalls_nid_no_patch` does not count them ([General.cpp L1020-L1023 at `main`](https://github.com/boykopovar/AnyPS5/blob/c674f8c14da93df7a6b37657117ca3f58357477f/core/libs/prx/libc/src/General.cpp#L1020-L1023)). The PR checklist says unimplemented paths throw through `NotImplemented_nid_no_patch`. Use it, or note the deviation in the debt bullet. 3. `_execvpe` reads the name with no length cap; the loop ends only at a NUL or an unreadable page ([AdditionalExports.cpp L326-L338 at the head](https://github.com/boykopovar/AnyPS5/blob/a37dcc1320fb22da78e9afe2744334cb0dac66aa/core/libs/prx/libkernel_sys/AdditionalExports.cpp#L326-L338)). `_execve` caps its path at 1024 bytes. A cap would bound host allocation for hostile names. 4. The points raised on closed #14275 (the relation to `execve`, exact-message asserts in the tests, and the debt bullet length) are not yet in the head. The `_execve` debt bullet is exactly 1000 characters, which is not over the `debt-length` warning threshold in `tools/check_conventions.py`. ## Sources - [Process.cpp `ExecProgram` and `execve` at upstream `main`](https://github.com/boykopovar/AnyPS5/blob/c674f8c14da93df7a6b37657117ca3f58357477f/core/libs/prx/libkernel/System/src/Process.cpp#L842-L913) - [NotImplemented_nid_no_patch at upstream `main`](https://github.com/boykopovar/AnyPS5/blob/c674f8c14da93df7a6b37657117ca3f58357477f/core/libs/prx/libc/src/General.cpp#L1020-L1023) - [Hosted Build run for the reviewed head](https://github.com/boykopovar/AnyPS5/actions/runs/41284550676) ## Not verified - No build and no local run of the two tests. The only test evidence is the hosted Windows job at this head; hosted Linux was skipped. - The Linux-only branches (`#ifndef _WIN32` EACCES cases and the Linux permission path) rest on the author's report of a local Linux build and `ctest -R 'guest_kernel_sys'` (28/28); not run here. - The errno ladders were not re-derived from the cited FreeBSD 11.4 sources. For example, whether `_execvpe` maps `ENAMETOOLONG` for a slash-containing name longer than 1024 bytes to `ENOENT` was not checked against FreeBSD. - The overlap with #14257, which also edits `AdditionalExports.cpp`, its header and the libkernel_sys debt file, was not resolved here. The PR's merge preview against current `main` is clean. - Console behavior of ELF and SELF acceptance is not verified, as the author notes. - No negative control was exercised.
MarcZX10 commented 2026-11-01 11:58:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T11:58:11Z.

Review: COMMENTED


Re-checked — new head, earlier points addressed in source

The four non-blocking points in my review at a37dcc1320 are addressed at 399bb8f19a in source, and I found no new blocking issue; approval waits for the hosted Windows run at this head, which is still queued.

What I ran

Exact head 399bb8f19a88a90515b9b77cc9ecf6cb56b7c3a8; PR base e67cc818696fd6e6c58ac80adc6550c54aed68e8, unchanged at completion. Delta read: a37dcc1320..399bb8f19a, limited to the PR's own commits (664b12ae45, d42bf12baf, 399bb8f19a). The merge commits from main in that range were not treated as PR changes. Environment: Linux, Python 3.11; no compiler and no build. Commands:

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14299
python3 tools/pr_abi_audit.py --base e67cc818696fd6e6c58ac80adc6550c54aed68e8 --head 399bb8f19a88a90515b9b77cc9ecf6cb56b7c3a8 --json
python3 tools/pr_test_quality.py --root <git archive of 399bb8f19a: core/libs/tests, core/libs/prx/libkernel_sys, core/libs/prx/libkernel, core/libs/CMakeLists.txt> --json core/libs/tests/GuestKernelSysExecve.cpp core/libs/tests/GuestKernelSysExecvpe.cpp core/libs/tests/GuestExecHost.cpp

The precheck's ABI and test-quality helpers were missing from the isolated head tree, so I ran both by hand from /marc/AnyPS5/tools.

Results

Check Result
Diff check, conventions and PR template (precheck) Passed
Live dependency and mergeability (precheck) Passed
ABI audit (by hand) Passed, 0 findings; lexical only
Test-quality heuristic (by hand) Three possible-unregistered-cpp-test findings, one per changed test file; false positives of the same kind as before, since CMake uses relative paths
Hosted checks at this head Eligibility, conventions, library-portability, labels and report passed; relinker and register-context jobs skipped; windows queued at 11:57 UTC; no hosted test result yet

Findings

Blocking: none.

Non-blocking, status of the earlier points:

  1. Relation to execve: addressed. The ELF, PS4 SELF and PS5 SELF branch of GuestExecve_nid_no_patch now calls execve_nid_postfix with checked argument and environment copies, instead of refusing (AdditionalExports.cpp, GuestExecve_nid_no_patch, at this head).
  2. Refusals outside NotImplemented_nid_no_patch: addressed for the exec path. The script and null-path refusals now use NotImplemented_nid_no_patch(__func__).
  3. Unbounded name in _execvpe: addressed. The name read stops at GuestCandidateMax (1024 bytes), and a name that fills the cap returns ENOENT.
  4. Exact-message assertions and debt bullet length: addressed. The tests check errno values only, and the _execve debt bullet is about 820 characters.

Sources

Not verified

  • The hosted Windows run at 399bb8f19a has not finished; no CTest result exists yet for this head.
  • No build and no run of the two exec tests; the Linux-only branches were not exercised.
  • Console behaviour of ELF and SELF activation is not verified.
  • No negative control was exercised.

To get this to a good state

Nothing further is needed from the author for the source points above. The approval waits for the hosted Windows run at 399bb8f19a.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5727927314 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14299#pullrequestreview-5727927314). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T11:58:11Z. **Review:** COMMENTED --- # Re-checked — new head, earlier points addressed in source The four non-blocking points in my review at `a37dcc1320` are addressed at `399bb8f19a` in source, and I found no new blocking issue; approval waits for the hosted Windows run at this head, which is still queued. ## What I ran Exact head `399bb8f19a88a90515b9b77cc9ecf6cb56b7c3a8`; PR base `e67cc818696fd6e6c58ac80adc6550c54aed68e8`, unchanged at completion. Delta read: `a37dcc1320..399bb8f19a`, limited to the PR's own commits (`664b12ae45`, `d42bf12baf`, `399bb8f19a`). The merge commits from `main` in that range were not treated as PR changes. Environment: Linux, Python 3.11; no compiler and no build. Commands: ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14299 python3 tools/pr_abi_audit.py --base e67cc818696fd6e6c58ac80adc6550c54aed68e8 --head 399bb8f19a88a90515b9b77cc9ecf6cb56b7c3a8 --json python3 tools/pr_test_quality.py --root <git archive of 399bb8f19a: core/libs/tests, core/libs/prx/libkernel_sys, core/libs/prx/libkernel, core/libs/CMakeLists.txt> --json core/libs/tests/GuestKernelSysExecve.cpp core/libs/tests/GuestKernelSysExecvpe.cpp core/libs/tests/GuestExecHost.cpp ``` The precheck's ABI and test-quality helpers were missing from the isolated head tree, so I ran both by hand from `/marc/AnyPS5/tools`. ## Results | Check | Result | |---|---| | Diff check, conventions and PR template (precheck) | Passed | | Live dependency and mergeability (precheck) | Passed | | ABI audit (by hand) | Passed, 0 findings; lexical only | | Test-quality heuristic (by hand) | Three `possible-unregistered-cpp-test` findings, one per changed test file; false positives of the same kind as before, since CMake uses relative paths | | Hosted checks at this head | Eligibility, conventions, library-portability, labels and report passed; relinker and register-context jobs skipped; `windows` queued at 11:57 UTC; no hosted test result yet | ## Findings **Blocking:** none. **Non-blocking, status of the earlier points:** 1. Relation to `execve`: addressed. The ELF, PS4 SELF and PS5 SELF branch of `GuestExecve_nid_no_patch` now calls `execve_nid_postfix` with checked argument and environment copies, instead of refusing ([AdditionalExports.cpp, `GuestExecve_nid_no_patch`, at this head](https://github.com/boykopovar/AnyPS5/blob/399bb8f19a88a90515b9b77cc9ecf6cb56b7c3a8/core/libs/prx/libkernel_sys/AdditionalExports.cpp)). 2. Refusals outside `NotImplemented_nid_no_patch`: addressed for the exec path. The script and null-path refusals now use `NotImplemented_nid_no_patch(__func__)`. 3. Unbounded name in `_execvpe`: addressed. The name read stops at `GuestCandidateMax` (1024 bytes), and a name that fills the cap returns ENOENT. 4. Exact-message assertions and debt bullet length: addressed. The tests check errno values only, and the `_execve` debt bullet is about 820 characters. ## Sources - [`GuestExecve_nid_no_patch` and `_execvpe` at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/399bb8f19a88a90515b9b77cc9ecf6cb56b7c3a8/core/libs/prx/libkernel_sys/AdditionalExports.cpp) ## Not verified - The hosted Windows run at `399bb8f19a` has not finished; no CTest result exists yet for this head. - No build and no run of the two exec tests; the Linux-only branches were not exercised. - Console behaviour of ELF and SELF activation is not verified. - No negative control was exercised. ## To get this to a good state Nothing further is needed from the author for the source points above. The approval waits for the hosted Windows run at `399bb8f19a`.
MarcZX10 commented 2026-11-01 12:00:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T12:00:35Z.

Review: COMMENTED


Re-checked — new head, two non-blocking points

This adds two points to the review at 399bb8f19a (5727927314) that it does not cover, and I found no blocking issue.

What I ran

Exact head 399bb8f19a88a90515b9b77cc9ecf6cb56b7c3a8, base e67cc818696fd6e6c58ac80adc6550c54aed68e8. Source read of core/libs/prx/libkernel_sys/AdditionalExports.cpp and core/libs/prx/libkernel/System/src/Process.cpp at this head. No build, no compile, no local test run. The precheck and helper results are the same as in 5727927314 and are not repeated here.

Findings

Blocking: none.

Non-blocking:

  1. Null pathname: _execve(NULL, argv, envp) now throws through NotImplemented_nid_no_patch (AdditionalExports.cpp L268), after the argument and environment copies. The libkernel execve debt entry records a null path as EBADF (measured) (docs/dev/debt/libkernel.md L240), and the same kernel's ExecProgram returns errnoBadFile (9) for a null file (Process.cpp L845). Null is therefore not clearly unsupported here. Either return EBADF in GuestExecve_nid_no_patch, or say in the _execve debt bullet (docs/dev/debt/libkernel_sys.md L352) why it differs from execve. _execvpe(NULL, ...) returns EFAULT at the same head, so the two new exports also differ from each other.
  2. Environment: ExecProgram keeps host environ entries that envp does not name (Process.cpp L876-L888). The libkernel debt entry documents this for execve, but execve(2) replaces the environment. _execve inherits the difference, and its debt bullet says only that it inherits libkernel limitations. Naming this one there would make it explicit.

Sources

To get this to a good state

A decision on the null-path answer (item 1), and naming the environment merge in the _execve debt bullet (item 2). Approval still waits for the hosted Windows run at this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5727934203 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14299#pullrequestreview-5727934203). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T12:00:35Z. **Review:** COMMENTED --- # Re-checked — new head, two non-blocking points This adds two points to the review at `399bb8f19a` (5727927314) that it does not cover, and I found no blocking issue. ## What I ran Exact head `399bb8f19a88a90515b9b77cc9ecf6cb56b7c3a8`, base `e67cc818696fd6e6c58ac80adc6550c54aed68e8`. Source read of `core/libs/prx/libkernel_sys/AdditionalExports.cpp` and `core/libs/prx/libkernel/System/src/Process.cpp` at this head. No build, no compile, no local test run. The precheck and helper results are the same as in 5727927314 and are not repeated here. ## Findings **Blocking:** none. **Non-blocking:** 1. Null pathname: `_execve(NULL, argv, envp)` now throws through `NotImplemented_nid_no_patch` (`AdditionalExports.cpp` L268), after the argument and environment copies. The libkernel `execve` debt entry records a null path as `EBADF` (measured) (`docs/dev/debt/libkernel.md` L240), and the same kernel's `ExecProgram` returns `errnoBadFile` (9) for a null file (`Process.cpp` L845). Null is therefore not clearly unsupported here. Either return `EBADF` in `GuestExecve_nid_no_patch`, or say in the `_execve` debt bullet (`docs/dev/debt/libkernel_sys.md` L352) why it differs from `execve`. `_execvpe(NULL, ...)` returns `EFAULT` at the same head, so the two new exports also differ from each other. 2. Environment: `ExecProgram` keeps host `environ` entries that `envp` does not name (`Process.cpp` L876-L888). The libkernel debt entry documents this for `execve`, but `execve(2)` replaces the environment. `_execve` inherits the difference, and its debt bullet says only that it inherits libkernel limitations. Naming this one there would make it explicit. ## Sources - [`GuestExecve_nid_no_patch` null-path check at `399bb8f19a`](https://github.com/boykopovar/AnyPS5/blob/399bb8f19a88a90515b9b77cc9ecf6cb56b7c3a8/core/libs/prx/libkernel_sys/AdditionalExports.cpp#L268) - [`ExecProgram` at `399bb8f19a`](https://github.com/boykopovar/AnyPS5/blob/399bb8f19a88a90515b9b77cc9ecf6cb56b7c3a8/core/libs/prx/libkernel/System/src/Process.cpp#L843-L888) - [libkernel debt entry for `execve` at `399bb8f19a`](https://github.com/boykopovar/AnyPS5/blob/399bb8f19a88a90515b9b77cc9ecf6cb56b7c3a8/docs/dev/debt/libkernel.md#L240) ## To get this to a good state A decision on the null-path answer (item 1), and naming the environment merge in the `_execve` debt bullet (item 2). Approval still waits for the hosted Windows run at this head.
MarcZX10 commented 2026-11-01 12:10:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T12:10:46Z.

Review: COMMENTED


Re-checked — new head, both points addressed in the debt entry

The two non-blocking points in the 12:00 review at 399bb8f19a are answered in the _execve debt bullet at f9474c5040, and no code change is needed for them.

What I ran

Exact head f9474c5040 (the only new commit is f9474c5040, which changes docs/dev/debt/libkernel_sys.md by one line). PR base e67cc818696fd6e6c58ac80adc6550c54aed68e8. No build, no compile and no test run. Source read of the code the bullet describes, at this head:

  • GuestExecve_nid_no_patch, the null-path check, AdditionalExports.cpp L268 (if (path == nullptr) NotImplemented_nid_no_patch(__func__);).
  • ExecProgram, the environment merge, Process.cpp L872-L891: host environ entries are kept unless the guest envp names them.

Findings

Blocking: none.

Non-blocking, status of the two points:

  1. Null pathname: addressed in the debt bullet. It now says that FreeBSD selects descriptor-based execution for a null pathname, that this activation is unmodelled, and that whether _execve shares libkernel execve's measured EBADF is unverified. That is the explanation the point asked for; returning EBADF is not required.
  2. Environment: addressed in the debt bullet. It now says that _execve merges host environ with envp name overrides instead of replacing the environment, which matches the code above.

Not verified

  • The hosted Windows run at f9474c5040 was not complete when I checked it.
  • No build and no run of the exec tests at this head; the docs change cannot change test results.
  • Console behaviour of the null pathname and of the environment merge is not measured here.

To get this to a good state

Nothing further is needed for these two points.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5727964926 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14299#pullrequestreview-5727964926). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T12:10:46Z. **Review:** COMMENTED --- # Re-checked — new head, both points addressed in the debt entry The two non-blocking points in the 12:00 review at `399bb8f19a` are answered in the `_execve` debt bullet at `f9474c5040`, and no code change is needed for them. ## What I ran Exact head `f9474c5040` (the only new commit is `f9474c5040`, which changes `docs/dev/debt/libkernel_sys.md` by one line). PR base `e67cc818696fd6e6c58ac80adc6550c54aed68e8`. No build, no compile and no test run. Source read of the code the bullet describes, at this head: - `GuestExecve_nid_no_patch`, the null-path check, [AdditionalExports.cpp L268](https://github.com/boykopovar/AnyPS5/blob/f9474c5040/core/libs/prx/libkernel_sys/AdditionalExports.cpp#L268) (`if (path == nullptr) NotImplemented_nid_no_patch(__func__);`). - `ExecProgram`, the environment merge, [Process.cpp L872-L891](https://github.com/boykopovar/AnyPS5/blob/f9474c5040/core/libs/prx/libkernel/System/src/Process.cpp#L872-L891): host `environ` entries are kept unless the guest `envp` names them. ## Findings **Blocking:** none. **Non-blocking, status of the two points:** 1. Null pathname: addressed in the debt bullet. It now says that FreeBSD selects descriptor-based execution for a null pathname, that this activation is unmodelled, and that whether `_execve` shares libkernel `execve`'s measured `EBADF` is unverified. That is the explanation the point asked for; returning `EBADF` is not required. 2. Environment: addressed in the debt bullet. It now says that `_execve` merges host `environ` with `envp` name overrides instead of replacing the environment, which matches the code above. ## Not verified - The hosted Windows run at `f9474c5040` was not complete when I checked it. - No build and no run of the exec tests at this head; the docs change cannot change test results. - Console behaviour of the null pathname and of the environment merge is not measured here. ## To get this to a good state Nothing further is needed for these two points.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!14299
No description provided.