fix(libkernel): connect libSceNet sockets #18474
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18474"
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 THEMANnt on 2026-11-11T17:37:26Z.
What
Route POSIX
connectfor alibSceNetdescriptor through the socket owner, preserving its connection bookkeeping and the kernel entry point's address validation.Tested
Windows x64, GCC 15.2. Built and passed
guest_sce_net_kernel_forwardson this branch. Connect a bound UDP socket to a loopback peer throughlibkerneland check that a null address returnsEFAULT. #17253 changes native address validation, and #18167 touches nearby regression code.All six socket bridge changes also passed the combined Windows socket and public header checks. Repository conventions passed for this branch. No retail title was run.
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-11-12T14:27:15Z.
Review: COMMENTED
Reviewed — no blocking findings
Read the diff of all four changed files and the head code it touches; I found no concrete defect, and nothing was built or run.
What I ran
Head SHA
45d177c61f240840d3f6d091fc752059e3aeb164, basemain. Read-only review through the repository reader, no build and no test run.Reader calls
Results
Forwardsfield order and the new lambdaconnectsits betweenbindandgetsocknamein bothsceNetConnectconnect_nid_postfixAddressLengthErrorreturns 14 before forwardingguest_sce_net_kernel_forwardsNegative control
Not run. I made no change to the code under test.
Findings
Blocking
None.
Non-blocking
core/libs/tests/GuestNetKernelForwards.cpp:78adds a connect and checks only its return value. A later send without an address, or a recv from another peer being dropped, would show the connection took effect. The test does not check either. Non-blocking, because the path itself reads correctly.Sources
github.com/boykopovar/AnyPS5@45d177c61f/core/libs/prx/libkernel/Socket/src/Udp.cpp (L1670-L1675)github.com/boykopovar/AnyPS5@45d177c61f/core/libs/prx/libkernel/Socket/src/Udp.cpp (L303-L307)github.com/boykopovar/AnyPS5@45d177c61f/core/libs/prx/libSceNet/Export.cpp (L1116-L1124)sceNetConnectbody:github.com/boykopovar/AnyPS5@45d177c61f/core/libs/prx/libSceNet/Export.cpp (L1495-L1545)Not verified
guest_sce_net_kernel_forwards, on Linux or Windows. The Windows run in the description is the author's report, not mine.sceNetConnectafter line 1545, and I did not read that part.bindchecks the length per family before forwarding (Udp.cpp:1825-1828); the connect path does not, so the check falls tosceNetConnectandguest_to_native_address. I did not read that function.To get this to a good state
No change is required for this review. Before merge, the author's own run of
guest_sce_net_kernel_forwardson the head45d177c61f240840d3f6d091fc752059e3aeb164should be rerun on Linux as well as Windows, and the reader'ssceNetConnecttail (after line 1545) should be checked for the bookkeeping the description claims.