Skip to content

fix(libkernel): return EFAULT from truncate, utimes, mkdir, rmdir, and rename for a null path - #7114

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
pushkarreddyy:fix/libkernel-rename-null-efault
Oct 17, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
pushkarreddyy:fix/libkernel-rename-null-efault

Conversation

@pushkarreddyy

@pushkarreddyy pushkarreddyy commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What

Following @oneandonlydean's review directive in #7114:
Folds #7110 (sceKernelTruncate, sceKernelUtimes), #7113 (sceKernelMkdir, sceKernelRmdir), and #7114 (sceKernelRename) together into this single PR, building cleanly on top of companion PR #7108 (sceKernelStat, sceKernelUnlink).

Like FreeBSD 11 (kern/vfs_syscalls.c), null path pointers reject early with EFAULT (0x8002000e) instead of throwing unhandled exceptions at runtime.

Closes #7110.
Closes #7113.

Tested

  • python tools/check_conventions.py --base origin/main passes with 0 findings.
  • core/libs/tests/GuestPosixScalarIo.cpp unit tests cover null path rejection for all 5 functions returning 0x8002000e.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: fix(libkernel): return EFAULT from sceKernelStat and sceKernelUnlink for a null path #7108
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Thanks @pushkarreddyy, this looks right too: GUEST_EFAULT is already defined, and the throw becomes an error. But #7108, #7110, #7113 and this one all add lines at the same spots in GuestPosixScalarIo.cpp, so every pair of them conflicts. To keep it simple: #7108 merges first, then one PR that folds #7110, #7113 and #7114 together, rebased on main after #7108. You can close the other two once the combined one is up (or reuse one of them). We'll run CI once on that head.

@pushkarreddyy

Copy link
Copy Markdown
Contributor Author

Thanks @oneandonlydean! Acknowledged — I have this folded together with #7110 and #7113 on a clean branch rebased on latest main, and will close this once #7108 merges.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6484 core/libs/prx/libkernel/File/src/Stdio.cpp L1273-1291

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/Stdio.cpp
PR 6044 core/libs/tests/GuestPosixScalarIo.cpp
PR 6222 core/libs/prx/libkernel/File/src/Stdio.cpp
PR 6287 core/libs/prx/libkernel/File/src/Stdio.cpp

@pushkarreddyy
pushkarreddyy force-pushed the fix/libkernel-rename-null-efault branch from 53d1069 to 7bb7608 Compare October 17, 2026 14:05
@pushkarreddyy pushkarreddyy changed the title fix(libkernel): return EFAULT from sceKernelRename for a null path fix(libkernel): return EFAULT from truncate, utimes, mkdir, rmdir, and rename for a null path Oct 17, 2026
@pushkarreddyy

Copy link
Copy Markdown
Contributor Author

@oneandonlydean
oneandonlydean merged commit e0d1f1b into boykopovar:main Oct 17, 2026
9 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