Feat/sandbox ca list 5001 #5091

Closed
MrMha wants to merge 2 commits from upstream-pr/5091 into main
MrMha commented 2026-10-13 11:18:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MrMha on 2026-10-13T11:18:33Z.


What

Propose a host-provided certificate bundle for /<sandbox word>/common/cert/CA_LIST.cer, addressing #5001. Carry screamm's offered commit dc51db5b4c517f731c07247b7702febd529e7922 without changing its implementation; the integration retains the original commit as a parent and preserves its authorship.

Add a libc path-provider registration API for an exact normalized, case-insensitive guest path. Libkernel registers the certificate path and generates its contents on the first resolution. Windows exports certificates from the current user's ROOT and CA stores. On non-Windows hosts, the provider uses the first readable regular file among SSL_CERT_FILE and the configured distro bundle paths.

The provider writes the selected bytes to cert_cache/CA_LIST.cer, setting a newly written cache file read-only, and caches the resolved path for the process. It checks for a BEGIN CERTIFICATE marker; it does not parse or validate certificates. An empty result falls back to ordinary guest-path resolution. Sibling paths receive no provider mapping.

The host trust-store design and console file format remain unverified. This PR is a design proposal; draft status is recommended until the design and implementation gaps below are resolved.

Tested

Prior local validation recorded for head 52fa8c361570d557d2ed115fb629183c4cb922b5: Linux x86-64, GCC 13.3.

  • Four focused native resolver/provider cases passed: explicit SSL_CERT_FILE, distro fallback, input without a certificate marker, and a blocked cache-directory write.
  • Checks covered bytes, normalized/case-insensitive lookup, new-cache permissions, timestamps and sibling names. The tested paths left no temporary files; this does not establish cleanup after every failure.
  • All four cases also passed with ASan/UBSan. LeakSanitizer was unavailable.
  • Compilation used C++20 and -Wall -Wextra -Werror; -Wno-deprecated-declarations covered the existing std::filesystem::u8path use. Local code-convention and whitespace checks were reported as passing.
    Those four results were supplied in the work record and were not rerun here. This review separately compiled the unchanged production certificate-provider source with a minimal provider-registration harness on Linux/GCC 13.3. Precreating an identical owner-writable cache reproduced the permissions bug described below. This harness does not exercise the real guest resolver, kernel/stream wrappers or TLS.

No full runtime build, guest_sandbox_certificates CTest, Windows-store export or title run is claimed for this integration head. Historical Windows/title and Linux results in #5001 concern the original branch and, for titles, additional patches. The inspected GitHub full Linux/Windows runtime jobs were skipped.

Outstanding work

  • Resolve the reproduced cache-permissions bug: the identical-content early return bypasses permission enforcement, so an existing writable cache stays writable.
  • Failure cleanup needs review: after temporary-file creation, later permission or rename failures can throw without removing the temporary file. This is a source-inspection finding, not a reproduced failure in this review.
  • Coordinate overlap with #4994 in General.cpp and #5008 in libkernel's test registration. Their implementations concern path-service lifetime and rename semantics, respectively; these overlaps do not by themselves establish dependencies.
  • At inspected main 5d50886ee4045dc2a081d8d93bf8e667f6d82325, this branch was 36 main commits behind, with merge base c7632f036f68f71a5e514f5b20f6df68a9062ada. Update it while preserving the carried commit and validate the resulting head.

Checklist

  • Based on current main; no other open PR implements the same functions (see outstanding work above)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no silent stubs added
  • No notes, investigation files or images added to the repository
  • No new third-party code
  • Generic behaviour, not specific to one title
  • Depends on: none (implementation dependency; overlap coordination is outstanding)
  • Unblocks: none (no locally verified title progress or Game bring-up discussion)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4842403228 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5091). Originally posted by [MrMha](https://github.com/MrMha) on 2026-10-13T11:18:33Z. --- ### What Propose a host-provided certificate bundle for `/<sandbox word>/common/cert/CA_LIST.cer`, addressing #5001. Carry screamm's offered commit `dc51db5b4c517f731c07247b7702febd529e7922` without changing its implementation; the integration retains the original commit as a parent and preserves its authorship. Add a libc path-provider registration API for an exact normalized, case-insensitive guest path. Libkernel registers the certificate path and generates its contents on the first resolution. Windows exports certificates from the current user's ROOT and CA stores. On non-Windows hosts, the provider uses the first readable regular file among `SSL_CERT_FILE` and the configured distro bundle paths. The provider writes the selected bytes to `cert_cache/CA_LIST.cer`, setting a newly written cache file read-only, and caches the resolved path for the process. It checks for a BEGIN CERTIFICATE marker; it does not parse or validate certificates. An empty result falls back to ordinary guest-path resolution. Sibling paths receive no provider mapping. The host trust-store design and console file format remain unverified. This PR is a design proposal; draft status is recommended until the design and implementation gaps below are resolved. ### Tested Prior local validation recorded for head `52fa8c361570d557d2ed115fb629183c4cb922b5`: Linux x86-64, GCC 13.3. - Four focused native resolver/provider cases passed: explicit `SSL_CERT_FILE`, distro fallback, input without a certificate marker, and a blocked cache-directory write. - Checks covered bytes, normalized/case-insensitive lookup, new-cache permissions, timestamps and sibling names. The tested paths left no temporary files; this does not establish cleanup after every failure. - All four cases also passed with ASan/UBSan. LeakSanitizer was unavailable. - Compilation used C++20 and `-Wall -Wextra -Werror`; `-Wno-deprecated-declarations` covered the existing `std::filesystem::u8path` use. Local code-convention and whitespace checks were reported as passing. Those four results were supplied in the work record and were not rerun here. This review separately compiled the unchanged production certificate-provider source with a minimal provider-registration harness on Linux/GCC 13.3. Precreating an identical owner-writable cache reproduced the permissions bug described below. This harness does not exercise the real guest resolver, kernel/stream wrappers or TLS. No full runtime build, `guest_sandbox_certificates` CTest, Windows-store export or title run is claimed for this integration head. Historical Windows/title and Linux results in #5001 concern the original branch and, for titles, additional patches. The inspected GitHub full Linux/Windows runtime jobs were skipped. ### Outstanding work - Resolve the reproduced cache-permissions bug: the identical-content early return bypasses permission enforcement, so an existing writable cache stays writable. - Failure cleanup needs review: after temporary-file creation, later permission or rename failures can throw without removing the temporary file. This is a source-inspection finding, not a reproduced failure in this review. - Coordinate overlap with #4994 in `General.cpp` and #5008 in libkernel's test registration. Their implementations concern path-service lifetime and rename semantics, respectively; these overlaps do not by themselves establish dependencies. - At inspected main `5d50886ee4045dc2a081d8d93bf8e667f6d82325`, this branch was 36 main commits behind, with merge base `c7632f036f68f71a5e514f5b20f6df68a9062ada`. Update it while preserving the carried commit and validate the resulting head. ### Checklist - [ ] Based on current `main`; no other open PR implements the same functions (see outstanding work above) - [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; no silent stubs added - [x] No notes, investigation files or images added to the repository - [x] No new third-party code - [x] Generic behaviour, not specific to one title - [x] Depends on: none (implementation dependency; overlap coordination is outstanding) - [x] Unblocks: none (no locally verified title progress or Game bring-up discussion) - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-13 11:25:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T11:25:21Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#5144 core/libs/prx/libkernel/File/src/SandboxCertificates.cpp
core/libs/tests/GuestSandboxCertificates.cpp
#5280 core/libs/prx/libkernel/File/src/SandboxCertificates.cpp
core/libs/tests/GuestSandboxCertificates.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6144474860 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5091#issuecomment-6144474860). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T11:25:21Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #5144 | | | `core/libs/prx/libkernel/File/src/SandboxCertificates.cpp`<br>`core/libs/tests/GuestSandboxCertificates.cpp` | | #5280 | | | `core/libs/prx/libkernel/File/src/SandboxCertificates.cpp`<br>`core/libs/tests/GuestSandboxCertificates.cpp` |
oneandonlydean commented 2026-10-14 02:33:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:33:31Z.


Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6159594310 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5091#issuecomment-6159594310). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T02:33:31Z. --- Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.
MrMha commented 2026-10-14 10:50:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MrMha on 2026-10-14T10:50:45Z.


Title-need evidence relevant to the closure, attributed to an existing public run rather than a new local title test:

@babyhuey's 14 October report on #5280 identifies ProsperoLichess, PPSA99009, Game bring-up #4982. On the reported main baseline f40b6930, Windows 11 / RTX 3080 / WinLibs GCC 15.2 Release, its log has:

ca=/gkbHtXc3Wq/common/cert/CA_LIST.cer (MISSING)
curl 77

The same report says merging #5280's 8fd97c29 onto that baseline changes the CA lookup to found and produces lichess probe status=200; the daily puzzle and Lichess TV load. This supplies a named title and baseline failure for the missing CA-file use case. Those are the contributor's results on those revisions, not an independent rerun or a claim about today's main or this PR's unchanged head.

#5280 already carries the original certificate implementation with additional trust/precedence fixes. Its maintainer review says the host-trust design awaits a decision in #5001. This PR also still lists cache-permission/cleanup findings in its description. The evidence supports the need for a CA-path solution, while validation and the design decision remain necessary; it does not establish this branch as merge-ready.

AI-assisted: yes (Codex).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6166674104 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5091#issuecomment-6166674104). Originally posted by [MrMha](https://github.com/MrMha) on 2026-10-14T10:50:45Z. --- Title-need evidence relevant to the closure, attributed to an existing public run rather than a new local title test: [@babyhuey's 14 October report on #5280](https://github.com/boykopovar/AnyPS5/pull/5280#issuecomment-6160869898) identifies **ProsperoLichess, PPSA99009, [Game bring-up #4982](https://github.com/boykopovar/AnyPS5/discussions/4982)**. On the reported main baseline `f40b6930`, Windows 11 / RTX 3080 / WinLibs GCC 15.2 Release, its log has: ```text ca=/gkbHtXc3Wq/common/cert/CA_LIST.cer (MISSING) curl 77 ``` The same report says merging #5280's `8fd97c29` onto that baseline changes the CA lookup to found and produces `lichess probe status=200`; the daily puzzle and Lichess TV load. This supplies a named title and baseline failure for the missing CA-file use case. Those are the contributor's results on those revisions, not an independent rerun or a claim about today's main or this PR's unchanged head. #5280 already carries the original certificate implementation with additional trust/precedence fixes. Its [maintainer review](https://github.com/boykopovar/AnyPS5/pull/5280#issuecomment-6162497719) says the host-trust design awaits a decision in #5001. This PR also still lists cache-permission/cleanup findings in its description. The evidence supports the need for a CA-path solution, while validation and the design decision remain necessary; it does not establish this branch as merge-ready. AI-assisted: yes (Codex).

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