Rust fd://3 socket activation adopts the fd blindly — no validation it is a listening socket
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 64/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- networking, security
Direzione di ricerca
Inizia dal percorso di dispatch di Rust per fd://3 e dal relativo helper di fd-wrapping, quindi confrontalo con la gestione esistente in Go in go/main.go:78. Esegui o aggiungi il test di subprocess proposto, che dup2s un listener reale su fd 3 ed esercita il percorso end-to-end. Il lavoro è completato quando un fd non valido fallisce rapidamente all’avvio con un errore chiaro, mentre un socket AF_UNIX valido in ascolto continua a funzionare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
With --listen-socket=fd://3, the Rust implementation adopts fd 3 via from_raw_fd without verifying it is actually a listening AF_UNIX socket. Go's net.FileListener (go/main.go:78) rejects non-socket fds; Rust only surfaces the problem later as io::Error from set_nonblocking/accept (mitigated by the accept-error backoff added in #27 — no busy loop, but also no clear early failure).
Neither implementation checks the LISTEN_PID/LISTEN_FDS environment variables from the sd_listen_fds convention, so this is parity-plus hardening.
Affected implementation(s)
- Rust
- Go (partially validates via
net.FileListener; also skipsLISTEN_FDSenv check)
Expected behavior
--listen-socket=fd://3 with an fd that is not a listening AF_UNIX socket should fail fast at startup with a clear error, not degrade into accept errors at runtime.
Suggested fix
Before adopting the fd:
fstatand checkS_IFSOCKgetsockopt(SOL_SOCKET, SO_ACCEPTCONN)to confirm it is listening- Optionally validate
LISTEN_PID == getpid()andLISTEN_FDS >= 1per the systemd convention (would also make sense in Go for parity)
Also worth a subprocess-based test that dup2s a real listener onto fd 3 and exercises the fd://3 dispatch path end-to-end (currently only the fd-wrapping helper is unit-tested).
Context
Split out from the review follow-ups on PR #27. Related: #25, #28.
- Lingua principale
- Rust
- Stelle
- 2
- Fork
- 0
- Merge medio
- 9h 35m
- PR unite (30g)
- 6
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ChainSafe/docker-socket-policy
-
Type: Documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Priority: P1 Type: Bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
Priority: P2 Type: Enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
Status: Break Change Type: Enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
Process exits 0 (Rust) / hangs (Go) when all listeners fail to bind — defeats Restart=on-failure ApertaPriority: P2 Type: Bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 65/100
Tutte le issue di ChainSafe/docker-socket-policy
Issue simili
-
bug github_actions
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
registrystack/registry-stack#1393 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
longbridge/gpui-kit#3223 ·
-
bug engine
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
rocky-data/rocky#2181 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
oasisprotocol/oasis-sdk#2523 ·
-
[indexer] [QA] Add a focused test for the new NonRetryableError / assertSocketAlive() behavior. Apertabot:ai-assisted component:indexer QA-roadmap status:untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
midnightntwrk/midnight-indexer#1557 ·