!agkXCfUrgbadYlQXRj:kack.it

NixOS + TPMs

184 Members
51 Servers

Load older messages


SenderMessageTime
14 Sep 2022
@elvishjerricco:matrix.orgElvishJerricco Zhaofeng Li: So moving over here because it seems more relevant: That patch doesn't seem to apply to NixOS. Based on the Loaded initrd from command line option message you see when booting with systemd-boot, that code path in that patch doesn't seem to measure the initrd 23:28:25
@elvishjerricco:matrix.orgElvishJerriccowhich is odd. I dunno why you'd only measure one of those two branches. Either it's measured elsewhere or this is a kernel bug23:30:45
@elvishjerricco:matrix.orgElvishJerriccoThough honestly I guess it doesn't matter. The attacker can always override the cmdline if you're not using a UKI anyway. So UKI it is23:53:37
15 Sep 2022
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @elvishjerricco:matrix.org
Zhaofeng Li: So moving over here because it seems more relevant: That patch doesn't seem to apply to NixOS. Based on the Loaded initrd from command line option message you see when booting with systemd-boot, that code path in that patch doesn't seem to measure the initrd
Wow, that's certainly very weird. What are those two code paths?
01:16:07
@elvishjerricco:matrix.orgElvishJerricco Zhaofeng Li: This branch does measure it, but this branch doesn't, which seems to be the one we hit with nixos 01:18:00
@zhaofeng:zhaofeng.liZhaofeng LiAh, so supplying initrd= via the cmdline doesn't trigger the measurement, awkward01:25:19
@elvishjerricco:matrix.orgElvishJerriccoand I can't imagine why they wouldn't want to measure it. It seems perfectly possible there01:25:40
@elvishjerricco:matrix.orgElvishJerricco Like, just move the measurement call to after the if else if block or something 01:26:25
@zhaofeng:zhaofeng.liZhaofeng LiNice opportunity to cook up a patch, it seems 👀01:28:36
@zhaofeng:zhaofeng.liZhaofeng LiAlso an opportunity to move to using the initrd directive in systemd-boot instead of adding the initrd= in the cmdline01:29:09
@elvishjerricco:matrix.orgElvishJerricco Zhaofeng Li: We do use the initrd directive. But (and I can't remember where I read this), I believe systemd-boot just converts that directive into an initrd= cmdline option. 01:31:41
@zhaofeng:zhaofeng.liZhaofeng LiIf this is the case, the systemd-boot docs are dangerously incorrect. This is very surprising.01:33:00
@elvishjerricco:matrix.orgElvishJerriccoThat's what this wiki says: https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/01:33:48
@elvishjerricco:matrix.orgElvishJerriccoWhere are the docs wrong about this?01:34:05
@elvishjerricco:matrix.orgElvishJerriccoAnd yea, my boot entries on my desktop have an initrd directive, but obviously I still get that "Loaded initrd from command line option" message01:34:39
@zhaofeng:zhaofeng.liZhaofeng LiI mean, the docs are wrong about initrd being measured in PCR 9 under normal usecases (the initrd directive)01:36:47
@elvishjerricco:matrix.orgElvishJerriccooh yes01:36:57
@elvishjerricco:matrix.orgElvishJerriccoyes that's certainly true01:37:01
@elvishjerricco:matrix.orgElvishJerriccoI don't have a way to test that right now or else I'd try it out to make sure01:37:18
@elvishjerricco:matrix.orgElvishJerricco(one of the next things I'm going to do in my bootspec-secureboot adventure is add TPM support to qemu-vm so I can test that with NixOS tests as well)01:37:58
@elvishjerricco:matrix.orgElvishJerricco(but for now my steam deck is my only tpm enabled device and I very much do not have nixos on it yet)01:38:18
@zhaofeng:zhaofeng.liZhaofeng Li (as you mentioned - haven't checked the docs myself as I'm on my phone) 01:38:27
@elvishjerricco:matrix.orgElvishJerricco * (one of the next things I'm going to do in my bootspec-secureboot adventure is add TPM support to qemu-vm.nix so I can test that with NixOS tests as well)01:38:30
18 Sep 2022
@greaka:greaka.degreaka left the room.11:35:26
19 Sep 2022
@cw:kernelpanic.cafeChinchilla Washington left the room.03:03:21
@lassulus:lassul.uslassulus joined the room.15:43:04
24 Sep 2022
@alexandre:iooss.fr@alexandre:iooss.fr https://nixos.wiki/wiki/TPM I just started a new wiki page to help users to use their TPM on NixOS
There is still things that I don't understand, I have set security.tpm2.tctiEnvironment.enable=true and have the corresponding environment variables pointing to device,/dev/tpmrm0, but OpenSSH is still trying to init FAPI backend (and fail)
13:21:04
30 Sep 2022
@joerg:thalheim.ioMic92 Alexandre: nice. How do you backup such a key? 11:53:10
@alexandre:iooss.fr@alexandre:iooss.fr
In reply to @joerg:thalheim.io
Alexandre: nice. How do you backup such a key?
I am still learning the spec, but maybe it is possible to import a key using tpm2-pkcs11 (which would allow a backup). It is clearly one of the question that needs to be answered on the wiki page ><"
11:55:51
2 Oct 2022
@leons:is.currently.onlineLeon
In reply to @alexandre:iooss.fr
https://nixos.wiki/wiki/TPM I just started a new wiki page to help users to use their TPM on NixOS
There is still things that I don't understand, I have set security.tpm2.tctiEnvironment.enable=true and have the corresponding environment variables pointing to device,/dev/tpmrm0, but OpenSSH is still trying to init FAPI backend (and fail)
I think this might be something I've noticed all over the TPM2 domain. It seems that almost every tool chooses its own generic-sounding environment variable to rely on.
19:16:40

Show newer messages


Back to Room ListRoom Version: 6