Stop one grant's engine from replacing another grant's engine socket

Aperta
#55 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
43/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, linux
Ambito
backend, security

Direzione di ricerca

Start with pkg/runtime/host/engine_linux.go and trace engineUID and makeEngineDir to see how grant engine directories and sockets are set up. Compare the two proposed options and check how fiberd passes its API socket descriptor. Done means one grant's engine cannot replace another grant's engine.sock across backends; the issue does not specify which option to implement.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Every grant's device engine runs as one uid, -engine-uid (engineUID in pkg/runtime/host/engine_linux.go), and fiberd hands each grant's engine directory <RunDir>/<grant>/engine/ to that uid (makeEngineDir). The engine binds engine.sock there itself.

So one grant's engine can reach every other grant's engine directory, since <RunDir>/<grant> is root's 0755 and the directories all belong to the same uid. An engine that a hostile fiber manages to compromise through its request lines could unlink another grant's engine.sock and bind its own in its place. That grant's fibers would then talk to the wrong engine, which can read and answer for their slices. The peer check does not help, because it runs inside the engine being impersonated.

This came up in the GPU PoC's (#4) review of the Cloud Hypervisor vsock link. It holds on every backend.

Options.

  • fiberd binds engine.sock as root and passes the listening descriptor to the engine, as it does for its own API socket, so the engine needs no write access to its directory.
  • Give each grant's engine its own uid, picked from a pool the way runc grants get user namespace slots.
Lingua principale
Go
Stelle
5
Fork
5
Merge medio
15h 27m
PR unite (30g)
41

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Azure/fiberd

Tutte le issue di Azure/fiberd

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.