Commit Graph
2 Commits
Author SHA1 Message Date
milescovielloandClaude Opus 5.5 9d2f3fb577 test(libkernel): check close-on-exec on a received host descriptor
The only MSG_CMSG_CLOEXEC case received sockets, whose F_GETFD reads the
guest's close-on-exec set, so it passed whether or not the received host
descriptor was marked. A pipe end goes through unchanged, so receiving
one with the flag now has to read back FD_CLOEXEC.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 18:43:15 +00:00
milescovielloandClaude Opus 5.5 2f196610dd feat(libkernel): pass descriptors in SCM_RIGHTS messages on Unix sockets
sendmsg on a guest Unix-domain socket now takes FreeBSD SCM_RIGHTS control
messages (SOL_SOCKET level, data at offset 16) and sends their descriptors
with the host's SCM_RIGHTS; recvmsg receives them, installs received sockets
as guest sockets and writes FreeBSD's control record back, truncated to the
caller's buffer with MSG_CTRUNC. A closed descriptor returns EBADF, another
level or an overlong record EINVAL. Windows, other control types, IP
sockets and MSG_PEEK with a control buffer still throw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 18:43:14 +00:00