Skip to content

fix(libSceSystemService): safely probe the path of the LoadExec calls - #20638

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
milescoviello:fix/systemservice-probe-load-exec-path
Nov 15, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
milescoviello:fix/systemservice-probe-load-exec-path

Conversation

@milescoviello

Copy link
Copy Markdown
Contributor

What

sceSystemServiceLoadExec checked *path, compared it with "exit" and handed it to PrepareLaunch, all straight through the guest pointer. sceLncUtilLoadExec read path[0] the same way before forwarding. A non-null path pointing at unmapped memory faulted the host.

Both now copy the path into a host string with CopyGuestPath_nid_no_patch (1024 bytes, the limit the other path calls use) before looking at it. sceLncUtilLoadExec forwards the copy. An unreadable path, or one without a terminator in 1024 bytes, returns the error each function gives a null path: SCE_SYSTEM_SERVICE_ERROR_PARAMETER and SCE_LNC_UTIL_ERROR_INVALID_ARGUMENT. The empty-path results (PARAMETER, and the throw in sceLncUtilLoadExec), the "exit" path, the launch checks and their messages are unchanged. The argument vector is still read in place.

The debt entry goes in a fragment under docs/dev/debt/changes/ and records this as unmeasured.

Tested

Linux (Ubuntu 26.04.1), GCC 15.2, Release.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: none
  • GPUs tested: n/a
  • AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oneandonlydean
oneandonlydean merged commit 6370c61 into boykopovar:main Nov 15, 2026
14 checks passed
@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 8651 core/libs/prx/libSceSystemService/Export.cpp
PR 15973 core/libs/tests/GuestSystemExit.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