Skip to content

fix(libkernel): return EFAULT from sceKernelStat and sceKernelUnlink for a null path - #7108

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
pushkarreddyy:fix/libkernel-stat-unlink-null-efault
Oct 17, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
pushkarreddyy:fix/libkernel-stat-unlink-null-efault

Conversation

@pushkarreddyy

Copy link
Copy Markdown
Contributor

What

sceKernelStat and sceKernelUnlink threw std::invalid_argument when passed a null path, terminating the calling title. In FreeBSD 11, sys_stat and sys_unlink return EFAULT (0x8002000e in PS5 errno) when the user path pointer cannot be copied from guest memory.

Both entry points now return 0x8002000e (SCE_KERNEL_ERROR_EFAULT) when path == nullptr instead of throwing.

Tested

Added unit tests in core/libs/tests/GuestPosixScalarIo.cpp (guest_posix_scalar_io) verifying that sceKernelStat and sceKernelUnlink with a null path fail with 0x8002000e without throwing.
python tools/check_conventions.py --base origin/main passed cleanly with zero findings.

Checklist

  • Conventional Commit title
  • Code follows the conventions in docs/dev/CONVENTIONS.md
  • Technical debt recorded in docs/dev/TechnicalDebt.md
  • Unit test added
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@github-actions

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 5021 core/libs/prx/libkernel/File/src/Open.cpp
PR 6044 core/libs/tests/GuestPosixScalarIo.cpp

@pushkarreddyy
pushkarreddyy force-pushed the fix/libkernel-stat-unlink-null-efault branch from a381ddc to 274f092 Compare October 17, 2026 13:11
@pushkarreddyy

Copy link
Copy Markdown
Contributor Author

Thank you @oneandonlydean for reviewing and merging #7103!

I have rebased #7108 directly onto latest origin/main (04788b090). As discussed on #7110 and #7113, once #7108 merges, I will immediately update #7110 with the folded changes (combining sceKernelTruncate, sceKernelUtimes, sceKernelMkdir, sceKernelRmdir, and sceKernelRename) and close #7113 and #7114.

Whenever you have a moment, please also check our other green PRs passing all CI checks:

@oneandonlydean
oneandonlydean merged commit ba5d2be into boykopovar:main Oct 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants