fix(libSceNet): read an option of a libkernel socket through sceNetGetsockopt #11243
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11243"
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 parl0v on 2026-10-25T22:28:47Z.
What
sceNetGetsockopton a descriptor that libSceNet doesn't own, but libkernel has open as a socket, now goes to libkernel'sgetsockopt(), which answers the options it models. Any other descriptor still fails withEBADF. The fallback runs afterg_mutexis released. It's the getter counterpart of3573289f2f, which added the same fallback tosceNetSetsockoptfor MXGP 26 (PPSA30839).Why
Human Fall Flat (PPSA02429) opens its sockets with libkernel's
socket()and reads options of them withsceNetGetsockopt. On upstream main every one of those calls fails withSCE_NET_ERROR_EBADF: the game printedsceNetGetsockopt failed with 0x8041010918 times in its first 60 s on my test box. On the console both libraries work on the same kernel sockets. That's the position8b81fa09bfand3573289f2falready take.Tested
CheckKernelSocketGetOptioninguest_sce_net, on a libkernel TCP socket:SO_SNDBUFthroughsceNetSetsockoptand reads it back throughsceNetGetsockopt, and the value matches libkernel's owngetsockopt.TCP_NODELAYand reads it back as nonzero.EINVAL.close()the call fails withEBADF.guest_sce_netfails. With the fix it passes. MinGW Release build, Windows 10.sceNetGetsockoptfailures over 150 s.python tools/check_conventions.py --base upstream/mainpasses.Related
getsockopton libSceNet sockets). The two compose: this fallback only runs when libkernel owns the descriptor, so the calls can't loop. Its hunk insceNetGetsockoptis in the option switch, and this one is at the table lookup at the top.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 (none added).mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T22:32:15Z.
Review: APPROVED
Reviewed exact head
6cbb4ff7fd81271de710d65a9ff0784fc7b4ee28. The fallback is limited to descriptors absent from libSceNet’s table that libkernel still recognizes as sockets, and it runs after releasingg_mutex, avoiding a lock inversion; native errno is translated through the libSceNet error path. The test compares SO_SNDBUF readback against libkernel and covers TCP_NODELAY, unsupported levels, and a closed descriptor. Current-main conventions/diff-check pass. Hosted product tests were skipped by path policy; the author reports the focused Windows test and title run, which I did not rerun locally.