fix(libkernel): return EFAULT from sceKernelMkdir and sceKernelRmdir for a null path #7113

Closed
pushkarreddyy wants to merge 1 commit from upstream-pr/7113 into main
pushkarreddyy commented 2026-10-17 12:08:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-17T12:08:25Z.


What

Return SceErrorFromErrno(GUEST_EFAULT) (0x8002000e) from sceKernelMkdir and sceKernelRmdir when path is null, matching FreeBSD 11 vfs_syscalls.c (sys_mkdir and sys_rmdir) where a null user pointer faults during path lookup instead of throwing a C++ exception.

Tested

Added unit tests in core/libs/tests/GuestPosixScalarIo.cpp verifying both functions return 0x8002000e when invoked with a null pointer.

Checklist

  • What
  • Tested
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4899922641 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7113). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-17T12:08:25Z. --- ### What Return `SceErrorFromErrno(GUEST_EFAULT)` (`0x8002000e`) from `sceKernelMkdir` and `sceKernelRmdir` when `path` is null, matching FreeBSD 11 `vfs_syscalls.c` (`sys_mkdir` and `sys_rmdir`) where a null user pointer faults during path lookup instead of throwing a C++ exception. ### Tested Added unit tests in `core/libs/tests/GuestPosixScalarIo.cpp` verifying both functions return `0x8002000e` when invoked with a null pointer. ### Checklist - [x] What - [x] Tested - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
oneandonlydean commented 2026-10-17 12:10:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T12:10:44Z.


Looks good, thanks. Same conflict as #7110 with #7108 (same two spots in GuestPosixScalarIo.cpp); the plan is in #7110: fold this one and #7110 into one PR after #7108 merges.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6233724803 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7113#issuecomment-6233724803). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-17T12:10:44Z. --- Looks good, thanks. Same conflict as #7110 with #7108 (same two spots in GuestPosixScalarIo.cpp); the plan is in #7110: fold this one and #7110 into one PR after #7108 merges.
pushkarreddyy commented 2026-10-17 12:21:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-17T12:21:45Z.


Understood, thanks @oneandonlydean! I will close this once #7108 lands and the folded PR (#7110) is updated with sceKernelMkdir, sceKernelRmdir, sceKernelTruncate, sceKernelUtimes, and sceKernelRename.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6233820319 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7113#issuecomment-6233820319). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-17T12:21:45Z. --- Understood, thanks @oneandonlydean! I will close this once #7108 lands and the folded PR (#7110) is updated with sceKernelMkdir, sceKernelRmdir, sceKernelTruncate, sceKernelUtimes, and sceKernelRename.
github-actions[bot] commented 2026-10-17 12:42:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T12:42:45Z.


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
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6234011745 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7113#issuecomment-6234011745). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-17T12:42:45Z. --- <!-- pr-overlap --> 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](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libkernel/File/src/Stdio.cpp` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestPosixScalarIo.cpp` | | [PR 6222](https://www.github.com/boykopovar/AnyPS5/pull/6222) | `core/libs/prx/libkernel/File/src/Stdio.cpp` | | [PR 6287](https://www.github.com/boykopovar/AnyPS5/pull/6287) | `core/libs/prx/libkernel/File/src/Stdio.cpp` |
pushkarreddyy commented 2026-10-17 14:06:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-17T14:06:13Z.


Closing in favor of consolidated PR #7114 following @oneandonlydean's directive (folding #7110, #7113, and #7114 together on top of #7108).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6234858336 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7113#issuecomment-6234858336). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-17T14:06:13Z. --- Closing in favor of consolidated PR #7114 following @oneandonlydean's directive (folding #7110, #7113, and #7114 together on top of #7108).

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!7113
No description provided.