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

Abierto
#55 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
43/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go, linux
Área
backend, security

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Go
Estrellas
5
Forks
5
Merge medio
15 h 27 min
PR fusionados (30 d)
41

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Azure/fiberd

Todos los issues de Azure/fiberd

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.