Repository navigation
fix(libkernel): keep socket descriptors within FD_SETSIZE - #8595
Merged
oneandonlydean merged 3 commits intoOct 20, 2026
Merged
Conversation
|
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.
|
Contributor
Author
|
Manual overlap check with #6044: that PR moves |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 repository