<div dir="auto">Ooh I see.<div dir="auto"><br></div><div dir="auto">Thanks for the heads up, I'll have a look to see which upstream kernels have this enabled as we are using upstream kernels directly.</div><div dir="auto"><br></div><div dir="auto">On the meantime it's trivial to extract the certs ourselves so it still works as expected :)</div><div dir="auto"><br></div><div dir="auto">Thanks Luca! I'll write an extra thread now with some more systemd-sysext questions!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mié, 5 jun 2024, 17:52, Luca Boccassi <<a href="mailto:luca.boccassi@gmail.com">luca.boccassi@gmail.com</a>> escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, 5 Jun 2024 at 15:15, Itxaka Serrano Garcia<br>
<<a href="mailto:itxaka.garcia@spectrocloud.com" target="_blank" rel="noreferrer">itxaka.garcia@spectrocloud.com</a>> wrote:<br>
><br>
> Hey all,<br>
><br>
> testing a bit the systemd-sysext with verity+signature, running a sample like this:<br>
><br>
> systemd-repart -S -s extension/ /run/extensions/k3sv1.30.0+k3s1.sysext.raw --private-key=db.key --certificate=db.pem<br>
><br>
> This generates a nice sysextension with verity and signed! (Nice work there BTW, its dead simple!)<br>
><br>
> But when trying to load it asks for a password, saying that the required key is not available<br>
><br>
> root@localhost:~# systemd-sysext status<br>
> HIERARCHY EXTENSIONS SINCE<br>
> /opt      none       -<br>
> /usr      none       -<br>
> root@localhost:~# systemd-sysext refresh<br>
> [  658.620707] device-mapper: table: 252:2: verity: Root hash verification failed (-ENOKEY)<br>
> [  658.621192] device-mapper: ioctl: error adding target to table<br>
> device-mapper: reload ioctl on 266b153bfd5592bf005a9ce9b15734f9293ecb3e095d1cb4b9f641f897ed7a22-verity (252:2) failed: Required key not available<br>
> 🔐 Please enter image passphrase: (press TAB for no echo)<br>
><br>
> Is this not supported? I can see some of my keys in the kernel keyring that match the keys in my FW:<br>
> 3dcac152 I------     1 perm 1f010000     0     0 asymmetri ITXAKA: 92b4fa443577dc2ccb116ca59f479a6652dc7b2d: X509.rsa 52dc7b2d []<br>
><br>
> But sysext claims that it cannot get it from the kernel keyring:<br>
><br>
> Validation of dm-verity signature failed via the kernel, trying userspace validation instead: Required key not available<br>
><br>
><br>
> The workaround is just to get the certificate and transform it into a nice x509 DER format under /run/verity.d/WHATEVER.crt<br>
><br>
> But I was wondering if there was a way for the sysext to just check against the EFI FW directly, get the public certs and try to verify against that?<br>
<br>
The kernel needs to be built with some non-default kconfigs, so if<br>
it's a custom build or distro check that those are all enabled, they<br>
are listed here:<br>
<br>
<a href="https://github.com/systemd/systemd/blob/main/README#L131" rel="noreferrer noreferrer" target="_blank">https://github.com/systemd/systemd/blob/main/README#L131</a><br>
</blockquote></div>