test(libkernel): audit listen socket backlog clamping and limit bounds #16577
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16577"
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 slopgobblercobbler on 2026-11-07T06:24:38Z.
What
This pull request adds unit and negative tests in
core/libs/tests/GuestSocketBacklog.cppauditing FreeBSD 11.4 POSIX socket listen backlog boundary clamping (SOMAXCONN = 128),EFAULTvalidation on invalidsockaddrand length pointers, and error evaluation precedence acrosslibkernelsocket APIs.The tests verify:
SOMAXCONN(128), negative values (-1,-128,-1000,INT_MIN), and oversized values (129,256,1024,65535,INT_MAX) all succeed without error and accept incoming connections as expected.EOPNOTSUPP), connected sockets (EINVAL), and invalid descriptors (EBADF).EFAULT) for null and unmapped pointers inbind,connect,sendto,recvfrom,getsockname, andgetpeername.ENAMETOOLONG,EINVAL) precedes memory validity (EFAULT) and descriptor lookup (EBADF).Tested
python tools/check_conventions.py --base upstream/main --head HEAD(0 findings).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 adriadam10 on 2026-11-10T21:35:23Z.
Review: CHANGES_REQUESTED
guest_socket_backlogfails on the current head, confirmed by @JJenkx on Windows (3 of 3 runs) and by the redwindowscheck:core/libs/tests/GuestSocketBacklog.cpp:179-183:sendtoon a never-connected stream socket returnsENOTCONN(57) on every host, notEFAULT. To testEFAULTfor the buffer and address pointers, use a connected socket (as lines 135-139 already set up). Please check the other rows on unconnected sockets (recvfrom,getpeername, 187-213) too.bind/connectlength vsEFAULTvsEBADF,connecton a listener givingEOPNOTSUPP). Please name the FreeBSD source (sys/kern/uipc_syscalls.c,kern_bind/kern_connect,getsockaddr) that each row follows.Once the test passes on the Windows and Linux Build runs, it can be merged.
Pull request closed