libkernel: sendfile crashes with SIGSEGV on invalid memory pointers instead of returning EFAULT #13525
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-30T17:38:43Z.
Environment
556547da71(currentorigin/main)Summary
In
core/libs/prx/libkernel/Socket/src/Udp.cpp,sendfile_nid_postfixdirectly reads guest pointerheadersand its nestedKernelIovecbuffers, and directly writes to*sbytes = sent;without guest memory validation:When a guest title or runtime passes an unreadable
headersstruct, an unreadableKernelIovecarray, or an unwritablesbytesbuffer (0x10),sendfile_nid_postfixcrashes the host process with a fatalSIGSEGVsegmentation fault rather than returningEFAULT(14) per FreeBSD 11.4sys_sendfile/kern_sendfile.I am implementing a fix with safe guest copying via
GuestCopyIn_nid_no_patchandGuestCopyOut_nid_no_patch, accompanying regression tests inGuestSendfile.cpp, and will submit a PR shortly.