fix(libkernel): keep socket descriptors within FD_SETSIZE #8595
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8595"
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 MarcZX10 on 2026-10-20T17:46:58Z.
What
Follow-up to merged #4391. Guest socket descriptors are stored in the same descriptor table used by the guest
fd_set, which has 1024 entries.ReserveNumberand the duplicate paths currently accept host descriptor numbers at or above 1024 when the table is under pressure. This change caps socket reservation,dup/fcntlduplication (including the minimum-descriptor form from #7437), anddup2at 1024. Any temporary host descriptor above the limit is closed and the operation returnsEMFILE.The regression fills descriptors up to 1024, then checks that
dup,F_DUPFD,F_DUPFD_CLOEXEC, socket creation, anddup2to descriptor 1024 fail withEMFILE. Thefcntlchecks cover both minimum descriptor 0 and the 1024 boundary.Tested
main892a4f1328a14a123eca4af8f3c9ea5d176133ab: GCC C++20 syntax checks pass forUdp.cppand the updatedGuestSocketDescriptors.cpp.git diff --checkpasses.python3 tools/check_conventions.py --base upstream/main --head HEADpasses.guest_socket_descriptorsCTest was attempted from the existing Linux build. The executable aborts during the global host CPU check, before entering the test body: this Xeon E5-1620 v2 lacks LZCNT, BMI1/2, MOVBE, AVX2 and FMA. The runtime assertions have not run on this host.Checklist
main; no other open PR implements the same behaviorNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T18:15:20Z.
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.
core/libs/prx/libkernel/Socket/src/Udp.cppcore/libs/tests/GuestSocketDescriptors.cppcore/libs/prx/libkernel/Socket/src/Udp.cppcore/libs/prx/libkernel/Socket/src/Udp.cppcore/libs/prx/libkernel/Socket/src/Udp.cppImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T18:41:13Z.
Manual overlap check with #6044: that PR moves
GuestSocketDescriptors.cpptocore/libs/tests/networking/GuestSocketDescriptors.cpp; it does not changeUdp.cpp. There is no implementation dependency, but the test edit needs to be carried to the moved path if #6044 merges first. Since #6044 is currently dirty againstmainand has requested changes, would you prefer #8595 to land first, or should I rebase the test onto the moved file after your PR? I leftDepends on: nonebecause the code does not require #6044.