Skip to content

fix(tsi): return EPERM for unpublished listen so guests keep INET sockets - #12

Merged
ZhiXiao-Lin merged 3 commits into
mainfrom
fix/tsi-eperm-unpublished-listen-main
Sep 14, 2026
Merged

ZhiXiao-Lin merged 3 commits into
mainfrom
fix/tsi-eperm-unpublished-listen-main

Conversation

@ZhiXiao-Lin

Copy link
Copy Markdown

Summary

  • Unpublished TCP/IPv6 try_listen now returns -EPERM instead of -EADDRNOTAVAIL.
  • krun-guest tsi_listen only keeps the native INET socket on -EPERM; any other errno fails guest listen().
  • Host isolation is unchanged: unmapped ports still do not bind on the host. None still auto-publishes. Unix sockets are unchanged.

Context

Follow-up to #11 / A3S-Lab/Box libkrun#371. Empty krun_set_port_map allowlists (A3S-Lab/Box scale endpoints, Box#370) need an in-guest listener so the vsock port-forward relay can connect(127.0.0.1, guest_port).

Box vendors this same patch on the existing submodule lineage (daec6e8498461c767f64a10d565c8a64adffcd7c) because that pin is not a fast-forward of this main.

Test plan

  • Unit: unpublished IPv4/IPv6 listen returns EPERM, not EADDRNOTAVAIL
  • Unit: mapped 80->8080 still remaps; None still auto-publishes
  • Empty allowlist: guest listen(8080) succeeds in-guest; host has no LISTEN on 8080
  • Guest-init / scale relay can connect to that in-guest listener

Made with Cursor

…kets

krun-guest tsi_listen only falls back to native listen on -EPERM.
EADDRNOTAVAIL made unpublished listen() fail, which broke MicroVM
port-forward relays after an empty krun_set_port_map allowlist
(A3S-Lab/Box#370). Host isolation is unchanged.

Co-authored-by: Cursor <[email protected]>
@ZhiXiao-Lin

Copy link
Copy Markdown
Author

Linux/macOS CI on this PR fails in setup with Unable to resolve action homebrew/actions@master, before any TSI code runs. Windows CI is green. The unpublished-listen change is -EPERM so krun-guest keeps a native INET socket (Box#370); it is not -EADDRNOTAVAIL. Box currently vendors daec6e8 from this lineage the same way libkrun#377 vendored the #11 equivalent.

GitHub no longer resolves Homebrew/actions@master. Composite actions still resolve every uses: entry before step ifs, so the macOS-only Homebrew step broke Linux unit and integration jobs before apt install.

Co-authored-by: Cursor <[email protected]>
@ZhiXiao-Lin

Copy link
Copy Markdown
Author

Pushed a CI-only follow-up: pin Homebrew/actions/setup-homebrew to 1f8e202… (2026.07.10.1). Composite actions resolve every uses: before step ifs, so the floating @master pin was failing Linux jobs before any TSI code ran.

Allow brew tap to fail closed on untrusted formula evaluation, then brew trust before install. Format the EPERM listen-map changes for cargo fmt --check.

Co-authored-by: Cursor <[email protected]>
@ZhiXiao-Lin
ZhiXiao-Lin merged commit 4bcd29f into main Sep 14, 2026
13 checks passed
@ZhiXiao-Lin
ZhiXiao-Lin deleted the fix/tsi-eperm-unpublished-listen-main branch September 14, 2026 10:37
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.

1 participant