Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd-sysext refuses to mount any extension if one is wrongly signed, even if its extension-release does not match os-release #32762

Open
valentindavid opened this issue May 11, 2024 · 2 comments · May be fixed by #32967
Labels
bug 🐛 Programming errors, that need preferential fixing sysext

Comments

@valentindavid
Copy link
Contributor

systemd version the issue has been seen with

256~rc1

Used distribution

GNOME OS Nightly

Linux kernel version used

6.7.9

CPU architectures issue was seen on

x86_64

Component

systemd-sysext

Expected behaviour you didn't see

/var/lib/extensions contains multiple raw images with signed verity. Developers need to switch kernel, with different keyrings (locally built vs CI built). So the extension might be signed for one or the other kernel. The os-release of host matches extension-release of only images that are signed with the corresponding kernel.

When merging extensions, systemd-sysext should ignore extensions that are not matching.

Unexpected behaviour you saw

Unfortunately, to read the extension-release, systemd needs to mount the extension. If one image fails to mount, then no extension is merged.

crypt_activate_by_signed_key gives ENODEV. And this does not get handled properly.

Steps to reproduce the problem

Create 2 extensions in /var/lib/extensions, with signed verity. Make sure one of them is signed with a key that is not present in the kernel or in /etc/verity.d. Make sure this extension does not match the os-release. Merge the extensions. And make sure that the other image, is properly signed and matches the os-release.
Run systemd-sysext merge.

Additional program output to the terminal or log subsystem illustrating the issue

No response

@valentindavid valentindavid added the bug 🐛 Programming errors, that need preferential fixing label May 11, 2024
@bluca
Copy link
Member

bluca commented May 12, 2024

The problem with ignoring broken ones is that you don't get any feedback when that happens, so not sure what's better. Maybe add a --graceful or so command line option?

@poettering
Copy link
Member

I am pretty sure we should apply what we can, and skip but log about the ones that do not apply. If we fail completely this sounds less than ideal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Programming errors, that need preferential fixing sysext
Development

Successfully merging a pull request may close this issue.

3 participants