Skip to content

fix(tsi): refuse host bind for unmapped guest listen ports - #11

Merged
ZhiXiao-Lin merged 1 commit into
mainfrom
fix/371-tsi-allowlist-on-main
Sep 14, 2026
Merged

ZhiXiao-Lin merged 1 commit into
mainfrom
fix/371-tsi-allowlist-on-main

Conversation

@ZhiXiao-Lin

Copy link
Copy Markdown

Summary

  • When host_port_map is Some, only mapped guest TCP/UDP ports bind on the host.
  • Unmapped ports previously fell back to the guest address and leaked LISTEN sockets on 0.0.0.0.
  • Empty maps now mean expose nothing, matching krun_set_port_map docs. Unix sockets unchanged.

Context

Required by A3S-Lab/Box libkrun#371 (default TSI without -p auto-publishing guest listeners).

Test plan

  • Empty port_map (Some({})): guest listen does not create host LISTEN
  • Explicit host:guest map still remaps and listens
  • None map keeps legacy auto-publish behavior

Made with Cursor

When host_port_map is Some, only mapped guest TCP/UDP ports may bind on
the host. Unmapped ports previously fell back to the guest address and
leaked LISTEN sockets on 0.0.0.0. Empty maps now mean expose nothing,
matching krun_set_port_map docs. Unix sockets are unchanged.

Co-authored-by: Cursor <[email protected]>
@ZhiXiao-Lin
ZhiXiao-Lin merged commit e33be62 into main Sep 14, 2026
3 of 13 checks passed
@ZhiXiao-Lin
ZhiXiao-Lin deleted the fix/371-tsi-allowlist-on-main branch September 14, 2026 07:02
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