fix(libkernel): report ELOOP for a path below a Windows symlink loop #8655
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8655"
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 cadenasynyster on 2026-10-20T20:08:07Z.
What
On Windows,
sceKernelOpenand POSIXopenof a path below a symbolic link that points to itself (loop/inside, withloop -> loop) returned ENOTDIR (20). FreeBSD returns ELOOP (62). The native open fails with ENOENT or ENOTDIR there, andNotFoundError_nid_no_patchthen reports ENOTDIR because the existing prefixloopis not a directory.When the native open fails with ENOENT or ENOTDIR,
OpenNativenow runs the loop check thatsceKernelStatalready uses (NativeSymbolicLinkLoop, which tests forERROR_CANT_RESOLVE_FILENAME) and returns ELOOP if it hits. The change is under_WIN32and only runs on the failure path.This is one row of #6983. It does not touch
WindowsOpenError_nid_no_patch, so it does not overlap with #8640, which maps theopen("loop")row there. The new checks sit in a different part ofGuestFilesystem.cpp.Tested
29e4c46b4.0x80020014, POSIX errno 20) foropen(loop/inside)on main. A directCreateFileWon bothloopandloop\insidefails with 1921 (ERROR_CANT_RESOLVE_FILENAME).guest_filesystemhas two new checks:sceKernelOpenofstat-loop/insidereturns0x8002003e, and POSIXopenreturns -1 with errno 62. With only theOpen.cppchange removed,guest_filesystemaborts with exit code 0xc0000409; with it, it passes.ctest -R "guest_filesystem|guest_path_name_length|file|stat|open|path": 75/75 passed.python tools\check_conventions.py --base origin/mainpasses.fopenof the same path, and the rename and unlink paths.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T20:10:54Z.
Review: APPROVED
Reviewed the diff and the Windows validation report. The loop check runs only after a failed open with ENOENT or ENOTDIR, uses the existing
NativeMetadataPathhandling for long paths, and returns the guest ELOOP code beforeNotFoundError_nid_no_patchcan turn the self-loop prefix into ENOTDIR. The two regressions cover thesceKernelOpenresult and POSIX errno. The Windows 11 run reports the focused test set passing 75/75. I found no blocking code issue. Hosted Linux and Windows build jobs are skipped, so that manual Windows run is the runtime evidence for this change.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T20:26:19Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libkernel/File/src/Open.cppcore/libs/tests/GuestFilesystem.cppcore/libs/prx/libkernel/File/src/Open.cppcore/libs/prx/libkernel/File/src/Open.cppcore/libs/prx/libkernel/File/src/Open.cppcore/libs/prx/libkernel/File/src/Open.cppcore/libs/tests/GuestFilesystem.cpp