fix(libkernel): keep socket buffer sizes and SO_NBIO as measured on a PS5 #10302
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10302"
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 orezraey on 2026-10-23T16:52:45Z.
What
getsockoptandsetsockoptmeasured on a retail PS5 (firmware 13.60) throughlibkernel_sys.sprxfrom a payload process. The sources and console logs are in this gist (pinettopinet3; the address cases ofpinetwent to #10299). The debt entry had these answers from the FreeBSD 11.4 source, or from the host.The console:
SO_SNDBUF/SO_RCVBUFof 32768/65536 (TCP, IPv4 and IPv6), 9216/42080 (UDP), 8192/8192 (AF_UNIXstream and seqpacket) and 2048/4096 (AF_UNIXdatagram), andSO_SNDLOWAT/SO_RCVLOWATof 2048/1;ENOBUFS(55) and below 1 withEINVAL;SO_NBIOback as 0x100 (SS_NBIO), not 1;setsockoptvalue with a length withEFAULTbefore it looks at the descriptor or the option, and answers a nullgetsockoptvalue with success and length 0.AnyPS5 read the host's buffer sizes, failed the low-water marks with
ENOPROTOOPT, readSO_NBIOas 1, and answered both null values withEINVAL. The four sizes are now kept per socket, set on the host as well, and copied to an accepted socket as FreeBSD'ssonewconndoes. The 6000-charactergetsockopt, setsockoptdebt entry is split by option, keeps only what still differs or was not measured, and now lists the options the console accepts that fail here (SO_REUSEPORT,SO_DEBUG,SO_TIMESTAMP,IP_TTL,IP_TOS,TCP_MAXSEG,TCP_KEEPIDLE).Tested
Windows 11, MinGW (winlibs).
guest_socket_optionschecks the defaults, the limits, the low-water clipping, theAF_UNIXsizes and the null values;guest_socket_stream_optionschecksSO_NBIO. The socket and net tests pass three runs in a row.-E "^agc_|^select_tests$") passes.tools/check_conventions.pypasses.tools/pr_overlap.py: #7511, #8448, #8921 touch nearby lines; whichever lands second keeps both.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)