!DBFhtjpqmJNENpLDOv:nixos.org

NixOS systemd

599 Members
NixOS ❤️ systemd165 Servers

Load older messages


SenderMessageTime
7 Oct 2024
@elvishjerricco:matrix.orgElvishJerriccooh23:54:20
@elvishjerricco:matrix.orgElvishJerriccono23:54:21
@elvishjerricco:matrix.orgElvishJerriccoI have an issue already23:54:25
@elvishjerricco:matrix.orgElvishJerricco initrd-nixos-activation.service 23:54:39
@elvishjerricco:matrix.orgElvishJerriccoit runs mid-initrd23:54:43
@elvishjerricco:matrix.orgElvishJerriccoand just runs whatever is at the system config path on sysroot23:54:54
@mjm:midna.devmjmuh oh23:55:07
@elvishjerricco:matrix.orgElvishJerricco i.e. if you're pwned there it has access to the enter-initrd phase 23:55:12
@elvishjerricco:matrix.orgElvishJerriccoyea that's a problem23:55:28
@elvishjerricco:matrix.orgElvishJerriccoI mean thankfully I don't think anyone is relying on pcrphase right now23:55:38
@elvishjerricco:matrix.orgElvishJerriccobut this is why auto-unlock is so damn hard23:55:44
@elvishjerricco:matrix.orgElvishJerricco
In reply to @elvishjerricco:matrix.org
I mean thankfully I don't think anyone is relying on pcrphase right now
(lanzaboote doesn't support it)
23:56:02
@elvishjerricco:matrix.orgElvishJerriccook, well, I think there's a solution to that23:56:29
@elvishjerricco:matrix.orgElvishJerricco We should run nixos activation After=initrd-switch-root.target and Before=initrd-switch-root.service. That target just causes everything to be stopped before it, and the service actually does the switch-root afterward 23:57:10
@elvishjerricco:matrix.orgElvishJerriccoso initrd is well and truly finished after the target23:57:18
@elvishjerricco:matrix.orgElvishJerriccowith only switch-root remaining23:57:23
@elvishjerricco:matrix.orgElvishJerriccothat's probably the right time to do activation23:57:29
@mjm:midna.devmjm and that would be after leave-initrd has already been measured into pcr 11? 23:57:50
@elvishjerricco:matrix.orgElvishJerricco yea, systemd-pcrphase-initrd.service will have been stopped before the target 23:58:08
@mjm:midna.devmjmthat makes sense23:58:16
@elvishjerricco:matrix.orgElvishJerricco yea, in this very specific sense, initrd-nixos-activation.service represents a notable security hole, where code is run from sysroot before sysroot is the real root 23:59:21
@elvishjerricco:matrix.orgElvishJerriccounderstandably, we weren't thinking about that back in 2022 :P23:59:39
8 Oct 2024
@elvishjerricco:matrix.orgElvishJerricco mjm: thanks for making me think of that! 00:00:50
@mjm:midna.devmjmyay 🎉00:05:07
@elvishjerricco:matrix.orgElvishJerriccoI wonder what other stuff uses sysroot before it's the right time. Upstream, I mean; where things are normal and not all nixos-y. Like repart will read partition definitions from sysroot during initrd, but that's not code execution from sysroot.00:10:00
@elvishjerricco:matrix.orgElvishJerriccofstab-generator will read mount definitions00:10:24
@elvishjerricco:matrix.orgElvishJerriccoagain not code execution...00:10:33
@elvishjerricco:matrix.orgElvishJerricco well, except for x-systemd.{requires,wants} 00:10:43
@elvishjerricco:matrix.orgElvishJerriccobut that only starts units that are already configured?00:11:02
@elvishjerricco:matrix.orgElvishJerricco like, if there was a pwn_my_systemd.ko kernel module, you could put x-systemd.requires=modprobe@pwn_my_system.service,x-initrd-mount in a fake sysroot's /etc/fstab 00:12:04

Show newer messages


Back to Room ListRoom Version: 6