mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-01 12:45:56 +00:00
pselect read its timeout directly, passed the guest signal mask straight to SetSignalMaskCatching_nid_no_patch, which dereferences it, and saved and restored the descriptor sets with memcpy after a caught signal, so a non-null pointer into unmapped or read-only memory crashed the host. It now copies the timeout and the mask in with GuestCopyIn_nid_no_patch, as FreeBSD's sys_pselect does before changing the mask, and saves and restores the sets with GuestCopyIn_nid_no_patch and GuestCopyOut_nid_no_patch, failing with EFAULT. A bad timeout or mask leaves the thread's signal mask unchanged.