Consider a separator for PCR[15] when leaving initrd

Abierto
#44,451 2 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
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
c, linux

Línea de trabajo

Start by reading the systemd-pcrphase implementation that measures leave-initrd into PCR[11], then trace how it handles PCR measurements and related tests. The requested behavior is to also measure a separator into PCR[15] at that point; done means the separator is extended there and the behavior is covered by a test. The issue does not name specific source or test files.

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

Descripción

cryptsetup needs-reporter-feedback ❓ RFE 🎁 tpm2
Component

No response

Is your feature request related to a problem? Please describe

Right now, when using e.g. tpm2-measure-pcr=yes to measure volume keys into PCR[15], there's the issue that failing the measurement will merely emit a warning into journald.

This has recently become an issue with the change to make systemd-cryptenroll use systemd-pcrextend.socket. Dracut does not ship that socket as of 112. ( I've made a fix, that's been merged into Dracut main and is scheduled for release 113 ). Same thing also affected Arch's mkinitcpio until 42.1.

Without this socket, instead of failing or an error, systemd-cryptenroll will emit

Sep 26 16:31:13 aurora systemd-cryptsetup[727]: Could not extend PCR: No such file or directory
Sep 26 16:31:13 aurora systemd-cryptsetup[727]: Could not extend NvPCR: No such file or directory

into the journal as warnings (second line is from tpm2-measure-nvpcr=yes).

The reason this is a problem is that when using say systemd-pcrlock with PCR[15] in the protection mask, you'd need to allow the state before the first volume key measurement and then each subsequent state. ( or if you bind to PCR[15] = 0, as some recommend, same deal ). So if PCR[15] = 0 is in the allow mask, and no measurements take place, then a foreign root system could be booted with your UKI and systemd-pcrlock would have all its protection masks fulfilled, and so the foreign root system would have access to pcrlock. This sort of defeats the point of using PCR[15] in the protection mask in the first place.

Describe the solution you'd like

A simple solution to protect against the issue would be to add a separator like systemd-pcrosseperator to PCR[15]. When systemd-pcrphase measures leave-initrd into PCR[11], the same measurement could be made into PCR[15].

I have a simple systemd unit that I include in my initrd, see here, that measures a separator into PCR[15] at the end of initrd, and would fail the boot even if this couldn't be measured.

The effect is that if any of tpm2-measure-pcr=yes measurements was absent, PCR[15] would have just the separator measured at the end of initrd, and this state is not allowed by my pcrlock policy, thus immediately locking that for good, and preventing the potential access in a foreign root system.

Describe alternatives you've considered

No response

The systemd version you checked that didn't have the feature you are asking for

262

Lenguaje dominante
C
Estrellas
17k
Forks
4.8k
Merge medio
2 d 10 h
PR fusionados (30 d)
342

Preparar el entorno

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 systemd/systemd

Todos los issues de systemd/systemd

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.