fix(libkernel): refuse TCP_MAXSEG before a connection and raise it to 216 as measured on a PS5 #11251
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11251"
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-25T22:40:49Z.
What
TCP_MAXSEGnow follows a retail PS5 (firmware 13.60) in three ways:AF_INET6stream socket starts at 1220.Measured with a homebrew probe from a payload process; the source and console log are in this gist (
pmaxseg).On the console:
AF_INETstream socket. Reads 536. Every set fails withEINVAL: 175, 176, 200, 400, 536, 537 and 1460. AnyPS5 accepted 176 to 536 here, and the debt entry said "no segment set succeeded there, so the rule here ... is not measured".AF_INET6stream socket. Reads 1220, FreeBSD'stcp_newtcpcbdefault. AnyPS5 read 536.tcp_default_ctloutputrule (optval <= t_maxseg,optval + 40 >= V_tcp_minmss) with the stored value raised toV_tcp_minmss(216).AnyPS5 now applies that rule only once the host socket has a peer (
getpeernamesucceeds), storesmax(value, 216), and startsAF_INET6sockets (and sockets accepted from anAF_INET6listener) at 1220.Before the first set, a connected socket still reads 536 or 1220 where the console reads the negotiated segment, because the host's MSS for a peer differs between hosts. That gap now leads the debt entry, together with the unmeasured listening socket.
Before and after
TCP_MAXSEGAF_INETstream socket (175 to 1460)EINVALEINVALAF_INET6stream socket readsEINVALEINVALEINVALTested
Windows 11, WinLibs GCC 15.2, full build. The 86 tests matching
socket|tcp|udp|net_pass 3 times out of 3, withselect_testsexcluded: it is a Python tool test that fails here for an unrelated temporary-directory reason.guest_socket_stream_optionsnow checks:AF_INET6socket reads 1220;tools/check_conventions.pypasses. Headea02895cc0onmainb90d009d9f. On WSL Ubuntu with GCC 13,guest_socket_stream_options,guest_socket_optionsandguest_tcppass 3 times out of 3 at the same head.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T22:42:14Z.
Review: APPROVED
Reviewed the exact head
ea02895cc071865dd32181ec74dcc4f217366503againstmainb90d009d9f73354cbea239a74a8f7e2dcd138772. The linked firmware 13.60 probe source and console log support the changed cases: all tested TCP_MAXSEG sets fail before connection; connected 176 and 200 read back as 216, while 400 fails; fresh AF_INET6 reads 1220. The state update and address-family initialization match those observations, and the debt entry records the remaining connected-read/listener limitations.git diff --checkandtools/check_conventions.py --base upstream/mainpass. Hosted eligibility, intake, conventions, labels, and report checks pass; hosted product build/test jobs were skipped by path policy. The author reports a full Windows 11 build and 86 relevant tests passing three times; I did not independently run that guest test locally.