feat(libkernel_sys): add chroot path validation #4384

Closed
MarcZX10 wants to merge 1 commit from upstream-pr/4384 into main
MarcZX10 commented 2026-10-12 08:30:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T08:30:16Z.


What

Carries the chroot path-validation implementation from issue #3632 onto current main. It returns guest errors for null, empty, missing, and non-directory paths, then explicitly throws for an existing directory because the guest path resolver keeps a fixed root and mount aliases are host paths.

This is only the chroot portion of #3632; other calls from that issue are separate changes.

Tested

  • Linux Release GCC 12.2 build: guest_kernel_sys_tests.
  • ctest --test-dir /tmp/AnyPS5-3632-chroot-build -R '^guest_kernel_sys$' --output-on-failure: 1/1 passed.
  • python3 tools/check_conventions.py: passed.
  • git diff --check upstream/main: passed.

Checklist

  • Based on current main; no other open PR implements the same function
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes; carried from the original implementation commit with authorship preserved
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4826863908 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4384). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T08:30:16Z. --- ### What Carries the `chroot` path-validation implementation from issue #3632 onto current `main`. It returns guest errors for null, empty, missing, and non-directory paths, then explicitly throws for an existing directory because the guest path resolver keeps a fixed root and mount aliases are host paths. This is only the `chroot` portion of #3632; other calls from that issue are separate changes. ### Tested - Linux Release GCC 12.2 build: `guest_kernel_sys_tests`. - `ctest --test-dir /tmp/AnyPS5-3632-chroot-build -R '^guest_kernel_sys$' --output-on-failure`: 1/1 passed. - `python3 tools/check_conventions.py`: passed. - `git diff --check upstream/main`: passed. ### Checklist - [x] Based on current `main`; no other open PR implements the same function - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes; carried from the original implementation commit with authorship preserved
github-actions[bot] commented 2026-10-12 08:36:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T08:36:43Z.


Progress report (1acfa7f → 33c14be)

📈 System libraries: 86.37% (+0.01%, +1 implemented functions)

✅ 1 implemented
Library Name
libkernel_sys chroot_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6120700960 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4384#issuecomment-6120700960). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T08:36:43Z. --- <!-- progress-report --> ### Progress report (1acfa7f → 33c14be) 📈 **System libraries**: 86.37% (+0.01%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libkernel_sys | `chroot_nid_postfix` | </details>
MarcZX10 commented 2026-10-12 08:41:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T08:41:55Z.


The PR description was corrected to use the template section headings (### What, ### Tested, ### Checklist) and now passes the local conventions checker. The current hosted conventions result reflects the earlier body. Posting this update to trigger a fresh PR check against the corrected description.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6120777921 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4384#issuecomment-6120777921). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T08:41:55Z. --- The PR description was corrected to use the template section headings (`### What`, `### Tested`, `### Checklist`) and now passes the local conventions checker. The current hosted conventions result reflects the earlier body. Posting this update to trigger a fresh PR check against the corrected description.
xXPBSXx commented 2026-10-12 11:22:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T11:22:27Z.


Windows test: head 8d8a251ac merged onto current main 3d8ffeb27 (clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release, -j4: full build 0 errors; ctest (guest_kernel_sys): 1/1 passed; python tools/check_conventions.py --base upstream/main passed. I did not run the new tests against main without the change.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6123261159 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4384#issuecomment-6123261159). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T11:22:27Z. --- Windows test: head `8d8a251ac` merged onto current `main` `3d8ffeb27` (clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release, `-j4`: full build 0 errors; ctest (guest_kernel_sys): 1/1 passed; `python tools/check_conventions.py --base upstream/main` passed. I did not run the new tests against `main` without the change. AI-assisted (Claude Code).
blawesom commented 2026-10-12 14:01:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-12T14:01:59Z.


Rebase handoff — rebased onto current main, authorship unchanged (only a TechnicalDebt.md union conflict; both entries kept).

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV):

  • builds; tools/check_conventions.py --base origin/main passes
  • full suite: 954/954 passed

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/4384
git checkout <your branch>
git merge --ff-only FETCH_HEAD
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6125841281 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4384#issuecomment-6125841281). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-12T14:01:59Z. --- **Rebase handoff** — rebased onto current `main`, authorship unchanged (only a `TechnicalDebt.md` union conflict; both entries kept). Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`, AMD RX 9070 XT / RADV): - builds; `tools/check_conventions.py --base origin/main` passes - **full suite: 954/954 passed** **To pick it up:** ``` git fetch https://github.com/blawesom/AnyPS5 rebase/4384 git checkout <your branch> git merge --ff-only FETCH_HEAD ```
oneandonlydean commented 2026-10-13 00:21:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T00:21:49Z.


Closing: chroot is still a predicted stop (the entry this adds to docs/dev/debt/libkernel_sys.md says "not yet observed in a run"), and it throws for an existing directory, so a title that got there would stop anyway. Please reopen with the PPSA99764 log line once a run on main stops at it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6135192759 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4384#issuecomment-6135192759). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T00:21:49Z. --- Closing: `chroot` is still a predicted stop (the entry this adds to `docs/dev/debt/libkernel_sys.md` says "not yet observed in a run"), and it throws for an existing directory, so a title that got there would stop anyway. Please reopen with the PPSA99764 log line once a run on main stops at it.

Pull request closed

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!4384
No description provided.