Repository navigation
feat(libkernel): implement sceKernelGetFsSandboxRandomWord - #9
Merged
Merged
Conversation
Returns the name of the directory under which a title's sandbox exposes system files, which homebrew SDKs splice into paths such as /<name>/common/cert/CA_LIST.cer and /<name>/common/lib/libc.sprx. The name is fixed here; recorded in TechnicalDebt together with the fact that nothing is mounted under it. Registers guest_sandbox_random_word. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
sceKernelGetFsSandboxRandomWordto libkernel, in a newSystem/src/Sandbox.cpp. On the console a title's sandbox root holdsapp0and a directory with a random-looking name under which system files are exposed; the function returns that name, and the open-source SDKs splice it into paths:/<name>/common/cert/CA_LIST.cer(ProsperoEden),/<name>/common/lib/libc.sprx(tiny-ps4-shell),/<name>/common/lib/mscorlib.dll(ps4-hen-plugins). The kernel keeps the name per process andrandomized_path(syscall 602) reads it back, as obliteration implements it, with/system/common/libmounted at<name>/common/lib.gkbHtXc3Wq, so a path built from it is the same across runs. It is recorded in TechnicalDebt: nothing is mounted under the name here, so/gkbHtXc3Wq/common/...resolves under the guest root like any other path and does not exist.In the Linux audit of the homebrew catalog (boykopovar#1578), the function was absent for 12 of the 34 relinked titles.
Overlap: none by
tools/pr_overlap.pyagainst the open pull requests. boykopovar#1748, boykopovar#1650 and boykopovar#1675 changeSystem/src/Process.cpp, which this does not touch; the source line goes afterProcess.cppinlibkernel/CMakeLists.txt, the test block afterguest_file_vector, and the TechnicalDebt entry after thesceKernelPreadone, clear of boykopovar#1802's rewrite of thesceKernelRaiseExceptionentries.Tested
BUILD_TESTING=ONandANYPS5_ENABLE_SPIRV_TOOLS=ONon this branch (based onmainb858fdc):ctest --repeat until-fail:3487/487;tools/check_test_registration.pyandtools/check_conventions.py --base upstream/mainpass.guest_sandbox_random_wordtest: a non-null, non-empty alphanumeric name, the same pointer on a second call and from another thread, andopenof/<name>/common/lib/libc.sprxfailing withENOENT. Written before the implementation; it failed on the unresolved export and passes with it.libkernel.prxexports the NID (JGfTMBOdUJo).tools/import_audit.pyon four of the 12 catalog titles, absent imports onmainb858fdc → this branch: PPSA17641 SymphonyStation5 35 → 34, PPSA97510 PSXS5 72 → 71, PPSA99009 ProsperoLichess 37 → 36, PPSA99082 OpenNOW PS5 - Prototype 36 → 35; the one that disappears is this function each time. No title was run, since each still has other absent imports, listed in Four open-source homebrew titles stop at start-up on unresolved imports (sysctl, pthread_set_name_np, isatty, mkstemp, signal sets, Opus decoders) boykopovar/AnyPS5#1578.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code