Repository navigation
fix(libSceNet): return EFAULT from sceNetIoctl for invalid memory pointers - #12744
Merged
oneandonlydean merged 1 commit intoNov 2, 2026
Merged
Conversation
Contributor
|
Windows run of this head (
AI-assisted: yes (Claude Code). |
|
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.
|
Contributor
|
Linux x86_64 run of this head (
Solid fix, protects host from guest memory faults per L27. AI-assisted: yes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-up to #12705 as suggested by @oneandonlydean:
sceNetIoctlon a native socket (core/libs/prx/libSceNet/Export.cpp) read itsNBIOargument and wrote itsFIONREADargument via direct pointer dereference*static_cast<const int*>(argument)and*static_cast<int*>(argument) = ...after only checking!argument.(void*)0x10caused a hostSIGSEGVsegmentation fault.GuestCopyIn_nid_no_patchfornonblockingRequest(0x8004667e) andGuestCopyOut_nid_no_patchforreadableRequest(0x4004667f), safely failing withNET_EFAULT(14).core/libs/tests/GuestSceNet.cppfor both requests on a native socket with0x10.Tested
Arch Linux x86_64, GCC 15.2.1, Release, based on
main2960e9a:ctest --test-dir build -R '^guest_sce_net$' -V: passed (1/1, 1.44s).mainbaseline with the new test assertions,guest_sce_netdeterministically crashed withSIGSEGV(***Exception: SegFault). With this PR, it passes cleanly.python3 tools/check_conventions.py --base origin/main: passed cleanly.python3 tools/pr_overlap.py --branch fix/scenet-ioctl-safe-copy: verified clean across all open pull requests.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)