Repository navigation
fix(libkernel): connect libSceNet sockets - #18474
Conversation
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
|
Windows CI passed. Both macOS |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Windows check of head Setup: Windows 11 x64, WinLibs GCC 15.2.0 (r7), Ninja, Release,
AI-assisted: yes. |
MarcZX10
left a comment
There was a problem hiding this comment.
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, base main. Read-only review through the repository reader, no build and no test run.
Reader calls
python3 repo_read.py search "connect_nid_postfix|bool Failed|Failed\(" core/libs/prx/libSceNet core/libs/tests/GuestNetKernelForwards.cpp core/libs/tests/GuestTest.hpp
python3 repo_read.py search "ForwardsFor" core/libs
python3 repo_read.py search "sceNetConnect" core/libs
python3 repo_read.py search "Forwards" core/libs
python3 repo_read.py cat core/libs/prx/libSceNet/Export.cpp 1495 1545
python3 repo_read.py cat core/libs/prx/libSceNet/Export.cpp 1088 1100
python3 repo_read.py cat core/libs/prx/libkernel/Socket/src/Udp.cpp 285 312
python3 repo_read.py cat core/libs/prx/libkernel/Socket/src/Udp.cpp 1668 1700
python3 repo_read.py cat core/libs/prx/libkernel/Socket/src/Udp.cpp 1822 1830
python3 repo_read.py cat core/libs/tests/GuestNetKernelForwards.cpp 1 40
python3 repo_read.py cat core/libs/tests/GuestNetKernelForwards.cpp 52 80
Results
| Check | Result | Note |
|---|---|---|
| Diff of the four changed files | passed | Read in full as hunks |
Forwards field order and the new lambda |
passed | connect sits between bind and getsockname in both |
Recursion through sceNetConnect |
passed | libSceNet does not call connect_nid_postfix |
| Null address returns EFAULT (14) | passed | Read only: AddressLengthError returns 14 before forwarding |
Build and test guest_sce_net_kernel_forwards |
not run | No build in this run |
| Windows socket and header checks | not run | Author-reported only |
Negative 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
- Forwarded connect path:
AnyPS5/core/libs/prx/libkernel/Socket/src/Udp.cpp
Lines 1670 to 1675 in 45d177c
- Address length check before forwarding:
AnyPS5/core/libs/prx/libkernel/Socket/src/Udp.cpp
Lines 303 to 307 in 45d177c
- Export lambda:
AnyPS5/core/libs/prx/libSceNet/Export.cpp
Lines 1116 to 1124 in 45d177c
sceNetConnectbody:AnyPS5/core/libs/prx/libSceNet/Export.cpp
Lines 1495 to 1545 in 45d177c
Not verified
- Build and run of
guest_sce_net_kernel_forwards, on Linux or Windows. The Windows run in the description is the author's report, not mine. - The description's claim that the connection bookkeeping is preserved. The bookkeeping sits in
sceNetConnectafter line 1545, and I did not read that part. - Wrong-length handling for a forwarded connect.
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. - The related PRs #17253 and #18167 named in the description, and the claim that no other open PR implements the same functions.
- Full text of the four changed files was not read; I read the hunks and their callers only.
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_forwards on the head 45d177c61f240840d3f6d091fc752059e3aeb164 should be rerun on Linux as well as Windows, and the reader's sceNetConnect tail (after line 1545) should be checked for the bookkeeping the description claims.
45d177c to
0c1f72b
Compare
|
The connect regression now sends a datagram without passing a destination after the forwarded connect and checks that the peer receives the payload. I also checked the connection bookkeeping at the end of
|
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)