libkernel: pthread and sce cancellation state and type getters fault on unwritable pointers #13568
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-30T18:30:49Z.
Environment
0a90776f7f(main)Describe the bug
scePthreadSetcancelstate,scePthreadSetcanceltype,pthread_setcancelstate_nid_postfix, andpthread_setcanceltype_nid_postfixwriteold_stateandold_typedirectly to guest pointers without copy safety verification. If an unwritable non-null pointer (e.g. into read-only memory or unmapped space) is provided, the host crashes withSIGSEGVinstead of returningSCE_KERNEL_ERROR_EFAULT(0x8002000e) or POSIX14(EFAULT).Expected behavior
Unwritable
old_stateorold_typepointers should fail copy-out viaGuestCopyOut_nid_no_patch, preserve the caller's cancellation state/type untouched, and returnSCE_KERNEL_ERROR_EFAULT/14(EFAULT).