fix(libkernel): report copied socket address lengths #4295
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4295"
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 AaravMehta-07 on 2026-10-12T05:06:55Z.
What
Report the copied address length from libkernel's shared
GuestAddressconversion instead of reporting 16/28 bytes when the caller supplied less space. This coversaccept,getsockname,getpeername,recvfromandrecvmsgwithout changing the address bytes or the no-sender paths.This addresses the remaining truncation gap noted in #3942, not that issue's already-fixed TCP sender-address bug. The reference is FreeBSD 11.4
uipc_syscalls.c:kern_accept4clampsnamelentosa_len,kern_getsockname/kern_getpeernamereturnMIN(*alen, sa_len), andkern_recvitreports the clampedmsg_namelen. Console hardware behavior has not been measured.The existing guest tests now check zero, one-byte, short, exact, oversized and
UINT32_MAXcapacities, address prefixes and untouched canaries. UDP exercises IPv4/IPv6 loopback, peeking and scatter/gather receives; TCP exercises both name queries and a one-byte accept address. IPv6 is skipped only for an unavailable family/loopback address.Open-PR searches found no matching truncation fix. #4272 changes receive write guards elsewhere in the same source file; it does not change this conversion helper.
Tested
BUILD_TESTING=ON: full CMake configuration and full default build passed. The 14 networking/address CTest cases passed (^guest_(tcp|udp|poll|socket.*|dup|addresses|datagram.*|sce_net)$).BUILD_TESTING=ON: full CMake configuration and full default build passed. All 15 networking/address tests passed (the Windows selection plusguest_select);guest_tcpandguest_udpalso pass ten repeated runs.check_conventions.pypassed with this title/body;pr_overlap.py --branch codex/kernel-socket-address-length --repo boykopovar/AnyPS5reported no overlap with open pull requests.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository