fix(libkernel): keep the SOL_SOCKET flags a PS5 accepts #10330
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10330"
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-23T18:02:25Z.
What
The SOL_SOCKET flag options measured on a retail PS5 (firmware 13.60) through
libkernel_sys.sprxfrom a payload process. The source and console log are in this gist (pinet4). This branch is on top of #10327 (and so #10320 and #10302), which edit the same debt entry and option state.On a stream socket the console:
SO_DEBUG(0x1),SO_USELOOPBACK(0x40),SO_REUSEPORT(0x200),SO_TIMESTAMP(0x400),SO_BINTIME(0x2000) and option 0x10000, reads each back as 0 at first, as its bit after any non-zero value, and as 0 after 0;SO_NO_OFFLOADandSO_NO_DDPin FreeBSD) but fails reading them withENOPROTOOPT;SO_ACCEPTFILTER) withEINVAL, which AnyPS5 still answers withENOPROTOOPT, as it was not part of this change.AnyPS5 failed all of them with
ENOPROTOOPT. They are now kept per socket as bits and copied to an accepted socket, as FreeBSD 11.4'ssonewconncopiesso_options. OnlySO_REUSEADDRandSO_REUSEPORTchange what the socket does, both set on the host (SO_REUSEPORTasSO_REUSEADDRon Windows). The timestamp options add no control message torecvmsg, listed under Silent stubs, and option 0x10000 andSO_ACCEPTFILTERare in the debt entries too.Tested
Windows 11, MinGW (winlibs).
c7b39854eb(main merged after #10327 landed):guest_socket_options,guest_socket_stream_optionsandguest_net_ctlpass three runs in a row on Windows (MinGW) and on Linux (WSL, GCC); the other socket and net tests also pass three runs on Windows.guest_socket_optionschecks each flag's read-back, the two write-only options and the short value. The socket and net tests pass three runs in a row.-E "^agc_|^select_tests$") passes apart fromguest_kqueue, which fails only under-j 14, as onmain.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)Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-24T05:39:18Z.
Review: COMMENTED
Checked against main
7c2400d29b, the pinet4 log in your gist, and FreeBSD 11.4 uipc_socket.c (sosetopt, sogetopt, sonewconn):do_setopt_accept_filter/do_getopt_accept_filter), but AnyPS5 still answers ENOPROTOOPT. That's in the PR body but not in either debt entry; could it go into the debt file? The general getsockopt entry also still says SO_REUSEADDR acts on the host and reads back as its bit, which is now the guest's kept bit.Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.