fix(libkernel): reject empty sceKernelOpen paths #3428
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3428"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T10:22:28Z.
Related to #3308.
What
Cyberpunk 2077 (PPSA04029 v02.120.000, Linux) reaches
sceKernelOpen("")during its launcher stage. On pre-fixmain, path resolution turns the empty string into the guest root directory, so the open succeeds and the following read throws. ReturnSCE_KERNEL_ERROR_ENOENTfor an empty path before resolving it, matching POSIXopen("")behavior. Add a directsceKernelOpenregression check; the existingopenwrappers already check the same error.Observed stop on pre-fix main:
The issue reporter's controlled probe on the same title continued past this stop when
sceKernelOpen("")returnedENOENT. This PR does not claim to resolve the title's later stops.Tested
guest_filesystem_tests;guest_filesystempassed 1/1 on the rebased branch.python3 tools/check_conventions.py --base upstream/main— passed.git diff --check— passed.Checklist
main(9a9bd3fb); no open PR implements this behaviorNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T10:47:32Z.
Checked on Linux:
guest_filesystempasses with the change and fails without it (the newsceKernelOpen("", 0, 0)row), no overlap with other open PRs. The empty-path check matches FreeBSDnamei(sys/kern/vfs_lookup.c, "Don't allow empty pathnames"); merging.The same hole exists in the other path-taking calls (
sceKernelStat,Rmdir,Rename,Chmod...), as noted in #3308; that is a separate topic for a follow-up PR.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T11:02:21Z.
I opened the requested separate follow-up in #3465 for the remaining kernel path-taking calls. It adds empty-path checks and
guest_filesystemregression coverage; it is based on currentmainand has no dependency on this PR.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T11:55:46Z.
Checked:
guest_filesystempasses with the change and fails without it (the newsceKernelOpen("", 0, 0)row); scoped build + ctest green (111/111). The empty-path check matches FreeBSDnamei("Don't allow empty pathnames"), andnullptrkeeps its previous path. Merging; the remaining path-taking calls are covered by #3465.