Repository navigation
fix(libkernel): fail scePthreadAttr calls with EFAULT on an unusable pointer - #15550
Merged
adriadam10 merged 1 commit intoNov 7, 2026
Merged
Conversation
…pointer Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
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.
|
Collaborator
|
Checked every |
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
scePthreadAttrInit,Destroy,Setdetachstate,Getdetachstate,Setguardsize,Getguardsize,Setinheritsched,Getinheritsched,Setschedparam,Getschedparam,Setschedpolicy,Getschedpolicy,Getstackaddr,Setstacksize,GetstacksizeandSetsoloschedread the attribute pointer, the attribute handle stored in guest memory, the scheduling parameter and the output pointers with plain dereferences. A pointer like0x10or one on an unreadable page crashed the host.Every guest pointer in these calls now goes through
GuestCopyIn_nid_no_patch/GuestCopyOut_nid_no_patch, and an unusable one fails withSCE_KERNEL_ERROR_EFAULT. The answers measured on a PS5 (firmware 13.60) stay: a null attribute pointer or handle givesEINVAL, a null output pointer givesEINVAL, a null scheduling parameter givesEOPNOTSUPP, andscePthreadAttrInit(NULL)still throws. The newEFAULTis checked after the attribute and before the value checks.Initfrees its allocation if the copy-out fails andDestroyclears the guest slot before freeing.scePthreadAttrSetstackaddr,scePthreadAttrGetsoloschedand the otherscePthreadAttrcalls are not touched (the first two are named by #9156 and #14798).This is a host-safety fix. FreeBSD dereferences these pointers and faults the process; no console behaviour is claimed, and the debt entry says the same.
Tested
Windows 11 (10.0.26200), WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
-DBUILD_TESTING=ON, on currentmain.guest_pthread_attr_errors: new checks for the0x10and unreadable-page attribute pointers on every call, and for0x10and unreadable output pointers and scheduling parameter (a null output keepsEINVAL). Onmainthe test crashes with a segmentation fault; on this branch it passes, three runs out of three.main(4f41f4c). Windows Defender quarantinedrelinker.exepart-way through the run (a false positive on this machine: its detection log namescore/relinker/relinker.exeand a trace-imports output file), so about 95 relinker script tests failed. After relinking, all of them pass alone, three times out of three, exceptwindows_trace_imports, whose output file Defender removes again. The other failures left arevulkan_validation_gate_reportsandcheck_compile_test_windows_gcc_response_text_mode_is_not_reinterpreted(the Windows Python in this environment),agc_driver_store_over_untracked(also fails here on unrelated branches cut from the samemaincommit), and GPUagc_driver_*timeouts and failures (for exampleagc_driver_native_depth_clearsandagc_driver_job_manager_compute_capacity) that pass in some alone-runs of the same binaries and fail in others on this loaded machine; skipped tests are GPU ones.python tools/check_conventions.py --base upstream/main: passes.Overlaps
tools/pr_overlap.pyreports no conflicting file; it only lists pull requests it could not compare indocs/dev/debt/libkernel.mdbecause they conflict withmainthemselves.pthread_attr_setstackaddr/getsolosched_npexports overscePthreadAttrSetstackaddrandscePthreadAttrGetsolosched, which this PR leaves alone; agit merge-treewith feat(libkernel_sys): implement pthread_attr_setstackaddr and pthread_attr_getsolosched_np #14798, fix(libkernel): start thread stacks on a 16 KiB page boundary on Linux #9684 and fix(libkernel_sys): validate guest pointers across system calls and pthread attributes #15000 is clean, and with feat(libkernel): implement four pthread_attr forms #9156 the only conflicts are the ones that PR already has withmain.Checklist
main; no other open PR implements the same functionNotImplemented_nid_no_patch); no silent stubs added.mdfiles or images added to the repositoryAI-assisted (Claude Code).
🤖 Generated with Claude Code