Skip to content

unix: fix host UDS recvmsg results#1370

Open
russellromney wants to merge 1 commit into
QuarkContainer:mainfrom
russellromney:codex/host-uds-recvmsg
Open

unix: fix host UDS recvmsg results#1370
russellromney wants to merge 1 commit into
QuarkContainer:mainfrom
russellromney:codex/host-uds-recvmsg

Conversation

@russellromney

@russellromney russellromney commented Jun 5, 2026

Copy link
Copy Markdown

Summary

Fix host Unix socket recvmsg passthrough.

The host UDS path already connects to bind-mounted host socket inodes. The receive side was returning the wrong result to the guest.

This change:

  • translates the Quark hostfd to the real OS fd before libc::recvmsg
  • returns the actual recvmsg byte count
  • returns errno as an error, not as a positive byte count
  • uses the host UDS recv wrapper on blocking retries
  • adds a static C regression client

Fixes #1369.

Test

Original bind-mounted UDS probe:

host process -> OK
runc         -> OK
runsc        -> connect-failed errno=111
quark rw     -> OK
quark ro     -> OK

Regression client under Quark:

host_uds_recv: 8 iterations ok
mode=rw ok
host_uds_recv: 8 iterations ok
mode=ro ok

Host UDS passthrough connected to bind-mounted host socket inodes, but the qvisor recvmsg wrapper did not translate Quark hostfd values to real OS fds. It also reported successful recvmsg calls as zero bytes and converted EAGAIN into a positive byte count.

Return the real recvmsg byte count, preserve negative errno values, and use the host UDS recv wrapper on blocking retries so SCM_RIGHTS translation stays consistent. Add a static regression client for bind-mounted host UDS replies.
@russellromney russellromney force-pushed the codex/host-uds-recvmsg branch from 4e39b5a to 75ccf00 Compare June 5, 2026 00:42
@yaoxin-jing yaoxin-jing self-requested a review June 12, 2026 22:29
@yaoxin-jing

Copy link
Copy Markdown
Collaborator

looks good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

host UDS recvmsg returns EOF or corrupt data

2 participants