Skip to content

fix(libkernel): return EFAULT from sceKernelWriteThrottlingStatus for a null status - #7133

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

oneandonlydean merged 1 commit into
boykopovar:mainfrom
pushkarreddyy:fix/libkernel-write-throttling-null-efault

Conversation

@pushkarreddyy

Copy link
Copy Markdown
Contributor

What

sceKernelWriteThrottlingStatus currently throws an unhandled exception (std::invalid_argument) when passed a null status buffer pointer. On FreeBSD / PS5 libkernel, kernel system calls receiving an invalid or null user pointer return SceErrorFromErrno(GUEST_EFAULT) (0x8002000e).

This change:

  • Replaces the throw with returning SceErrorFromErrno(GUEST_EFAULT) when status == nullptr.
  • Adds a unit test in core/libs/tests/GuestFilesystem.cpp verifying sceKernelWriteThrottlingStatus(nullptr) returns 0x8002000e.
  • Updates docs/dev/debt/libkernel.md documenting the null status pointer EFAULT return.

Tested

  • Windows 11, GCC 15 (MinGW-w64), Release build.
  • python tools/check_conventions.py --base origin/main: 0 findings, 0 errors.

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: none
  • Fixes: none
  • Unblocks: PPSA17221 Minecraft Bedrock (PPSA17221) runs on Windows: boots to a playable world, 0 absent imports #5744
  • GPUs tested: n/a
  • AI-assisted: yes

@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 6228 docs/dev/debt/libkernel.md L123-124

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
docs/dev/debt/libkernel.md
PR 6044 core/libs/tests/GuestFilesystem.cpp
PR 6222 core/libs/prx/libkernel/File/src/Stdio.cpp
docs/dev/debt/libkernel.md
PR 6287 core/libs/prx/libkernel/File/src/Stdio.cpp
PR 6510 docs/dev/debt/libkernel.md
PR 6710 docs/dev/debt/libkernel.md
PR 6962 docs/dev/debt/libkernel.md
PR 7201 core/libs/prx/libkernel/File/src/Stdio.cpp

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