fix(libkernel): return EFAULT from sceKernelTruncate and sceKernelUtimes for a null path #7110
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7110"
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 pushkarreddyy on 2026-10-17T12:04:20Z.
What
sceKernelTruncateandsceKernelUtimesthrewstd::invalid_argumentwhen called with a null path. In FreeBSD 11,sys_truncateandsys_utimesfail withEFAULT(0x8002000ein PS5 errno) when copying the path from user space fails.Both entry points now return
0x8002000e(SCE_KERNEL_ERROR_EFAULT) whenpath == nullptrinstead of throwing.Tested
Added unit tests in
core/libs/tests/GuestPosixScalarIo.cpp(guest_posix_scalar_io) verifying thatsceKernelTruncateandsceKernelUtimesfail with0x8002000eon a null path without throwing.python tools/check_conventions.py --base origin/mainpassed cleanly with zero findings.Checklist
docs/dev/CONVENTIONS.mddocs/dev/TechnicalDebt.mdImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T12:10:43Z.
Thanks, @pushkarreddyy. This and #7113 both look right: null path -> EFAULT, same pattern as #7108.
One practical problem: #7108, #7110 and #7113 all add lines at the same two places in
core/libs/tests/GuestPosixScalarIo.cpp. Each merges cleanly into main on its own, but as soon as one lands the other two conflict.Plan: #7108 merges first. After that, could you fold #7110 and #7113 into one PR rebased on main? While you're there,
sceKernelRename(Stdio.cpp:1273) still throws on a null path and fits the same change. We'd then run CI once on the combined head.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T12:17:00Z.
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/Stdio.cppcore/libs/tests/GuestPosixScalarIo.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libkernel/File/src/Stdio.cppImported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-17T12:21:34Z.
Thanks @oneandonlydean! That plan makes total sense.
I have rebased on latest main and prepared the combined branch holding the full remaining set (sceKernelTruncate, sceKernelUtimes, sceKernelMkdir, sceKernelRmdir, and sceKernelRename).
Whenever #7108 merges into main, I will immediately update this PR (#7110) with the folded commits and close #7113 and #7114 so CI runs cleanly once on the combined head.
Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-17T14:06:11Z.
Closing in favor of consolidated PR #7114 following @oneandonlydean's directive (folding #7110, #7113, and #7114 together on top of #7108).
Pull request closed