mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-12-05 17:11:09 +00:00
send and recv handed the guest buffer to the host call unchecked, so an unreadable or unwritable buffer got whatever the host did, where sendto and recvfrom fail with EFAULT. FreeBSD 11.4's libc send and recv are sendto and recvfrom without an address, so give them the same checks: on Windows send rejects a buffer that is not wholly readable through SourceFaults, which also prepares guest memory for the host read, and recv receives only into the writable prefix, failing with EFAULT and leaving stream data queued (dropping a datagram) when the pending data does not fit it. Linux was already the same as sendto and recvfrom; macOS still keeps a faulted datagram in recv, as the debt entry says. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
577 B
577 B
libkernel
change [send and recv]
- send, recv, sendto and recvfrom (libkernel) - on Windows a stream receive whose writable prefix is shorter than the queued data fails with
EFAULT, but data arriving after the check, orMSG_WAITALL, can return the prefix as a short success where FreeBSD fails. Linux and macOS return the bytes copied before a fault on a stream, where FreeBSD returnsEFAULT. On macOS a datagram whose copy into arecvbuffer faults stays queued, whererecvfromdrops it as FreeBSD does.