Repository navigation
sys/linux: fix and extend AF_VSOCK descriptions - #8086
Merged
Merged
Conversation
`accept4$vsock_stream` passed `addrlen` by value, so `accept4()` always failed with `-EFAULT` and accepted sockets never reached the fuzzer. The descriptions also had no `SOCK_SEQPACKET` sockets, no `svm_flags`/`VMADDR_FLAG_TO_HOST`, no `getsockopt` or 64-bit connect timeout, and no typed `MSG_ZEROCOPY` path. vsock diag dumps used the 2-byte generic `sock_diag_req`, which `vsock_diag_handler_dump()` rejects because it needs a 24-byte `struct vsock_diag_req`. Fix `accept4$vsock_stream`, split `svm_zero` into `svm_flags` and padding, and add `socket$vsock_seqpacket`, `getsockopt$vsock`, `setsockopt$SO_VM_SOCKETS_CONNECT_TIMEOUT_NEW`, `setsockopt$SO_ZEROCOPY_vsock`, `sendmsg$vsock_stream`, and `sendmsg$vsock_diag`. `sendmsg$vsock_stream` uses a vsock-specific `send_msghdr_vsock` without a destination, since `vsock_connectible_sendmsg()` rejects messages that carry one. Add manual seed programs for loopback stream (including zerocopy and diag), seqpacket, and vhost-vsock transport selection.
There was a problem hiding this comment.
Code Review
This pull request expands the Linux system call descriptions for AF_VSOCK, adding support for SOCK_SEQPACKET, getsockopt, sendmsg, SO_ZEROCOPY, and vsock_diag netlink monitoring, along with corresponding test cases. The feedback suggests defining a flag set for the vdiag_show field in vsock_diag_req instead of hardcoding it to a constant zero, which will allow the fuzzer to properly exercise the kernel's detailed socket info paths.
a-nogikh
approved these changes
Oct 30, 2026
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.
Split out of #8049 as requested.
accept4$vsock_streampassedaddrlenby value, soaccept4()always failed with -EFAULT and accepted sockets never reached the fuzzer. The descriptions also had noSOCK_SEQPACKETsockets, nosvm_flags/VMADDR_FLAG_TO_HOST, nogetsockoptor 64-bit connect timeout, and no typedMSG_ZEROCOPYpath.vsock diag dumps used the 2-byte generic
sock_diag_req.vsock_diag_handler_dump()rejects it because it needs a 24-bytestruct vsock_diag_req.This fixes
accept4$vsock_streamand splitssvm_zerointosvm_flagsand padding. It addssocket$vsock_seqpacket,getsockopt$vsock,setsockopt$SO_VM_SOCKETS_CONNECT_TIMEOUT_NEW,setsockopt$SO_ZEROCOPY_vsock,sendmsg$vsock_streamandsendmsg$vsock_diag. Per the review comment on #8049,sendmsg$vsock_streamuses a vsock-specificsend_msghdr_vsockwithout a destination, sincevsock_connectible_sendmsg()rejects one.Manual seeds cover loopback stream (zerocopy, diag), seqpacket and vhost-vsock transport selection.
Tested:
make descriptions; the seeds parse in strict mode on all arches (pkg/runtest TestParsing);pkg/csourcetests.