* [ISSUE] Decrypting key for luks root partition fails with recent kernel/dracut
@ 2022-11-22 21:26 mithodin
2022-11-23 1:30 ` sgn
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: mithodin @ 2022-11-22 21:26 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1774 bytes --]
New issue by mithodin on void-packages repository
https://github.com/void-linux/void-packages/issues/40703
Description:
### Is this a new report?
Yes
### System Info
Void 5.19.10_1 x86_64 GenuineIntel uptodate rrFFFFFFFF
### Package(s) Affected
linux-6.0_1, dracut-053_5, gnupg-2.3.8_1
### Does a report exist for this bug with the project's home (upstream) and/or another distro?
_No response_
### Expected behaviour
gnupg is used at boot time to decrypt a key that is configured via the grub commandline with rd.luks.key to decrypt my root filesystem.
### Actual behaviour
The root filesystem fails to decrypt because the key file fails to decrypt.
### Steps to reproduce
1. Create a small partition holding a gpg-encrypted key file "root.key.gpg" for the root drive, which is luks encrypted
2. Put the private key capable of decrypting this key onto a yubikey.
3. Configure dracut to use this key at boot time via the grub commandline rd.luks.key=/root.key.gpg:UUID=<root fs UUID>
4. Add add_dracutmodules+=" crypt-gpg " to /etc/dracut.conf
5. Boot the computer with the yubikey plugged in
I have an initramfs with linux-5.19.10_1 where the process works fine. It used to work fine for many kernel versions, in fact. But starting with linux-5.19.15, the decryption fails. The root cause seems to be that gpg fails to decrypt the key file. On the rescue shell, I have confirmed that
- gpg is able to access the yubikey (gpg --card-status lists it and gpg --edit-card shows the properties correctly)
- gpg fails to decrypt the key file, giving only the message "unexpected error". Adding --verbose yields no additional information.
I'm at a loss where to go from here. I'm not even sure which of the involved components introduced the failure.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Decrypting key for luks root partition fails with recent kernel/dracut
2022-11-22 21:26 [ISSUE] Decrypting key for luks root partition fails with recent kernel/dracut mithodin
@ 2022-11-23 1:30 ` sgn
2022-11-23 7:07 ` mithodin
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: sgn @ 2022-11-23 1:30 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 219 bytes --]
New comment by sgn on void-packages repository
https://github.com/void-linux/void-packages/issues/40703#issuecomment-1324437366
Comment:
Can you check if the `gpg` inside your `5.19.10` initramfs is `gnupg` v1 or v2?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Decrypting key for luks root partition fails with recent kernel/dracut
2022-11-22 21:26 [ISSUE] Decrypting key for luks root partition fails with recent kernel/dracut mithodin
2022-11-23 1:30 ` sgn
@ 2022-11-23 7:07 ` mithodin
2022-11-24 1:18 ` sgn
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: mithodin @ 2022-11-23 7:07 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 259 bytes --]
New comment by mithodin on void-packages repository
https://github.com/void-linux/void-packages/issues/40703#issuecomment-1324633805
Comment:
it is gpg v2 in both cases. The 5.19.10 initramfs is running version 2.3.7, whereas the broken initramfs has 2.3.8
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Decrypting key for luks root partition fails with recent kernel/dracut
2022-11-22 21:26 [ISSUE] Decrypting key for luks root partition fails with recent kernel/dracut mithodin
2022-11-23 1:30 ` sgn
2022-11-23 7:07 ` mithodin
@ 2022-11-24 1:18 ` sgn
2022-11-24 1:19 ` sgn
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: sgn @ 2022-11-24 1:18 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 409 bytes --]
New comment by sgn on void-packages repository
https://github.com/void-linux/void-packages/issues/40703#issuecomment-1325829883
Comment:
When you break into initramfs, please:
```
mkdir -p ${HOME}/.gnupg
echo "log-file /tmp/gpg.log" >>/tmp/gpg.conf
echo "log-file /tmp/gpg-agent.log" >>/tmp/gpg.conf
gpgconf --kill gpg-agent
```
After that, try to decrypt the luks key again, then show us the log.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Decrypting key for luks root partition fails with recent kernel/dracut
2022-11-22 21:26 [ISSUE] Decrypting key for luks root partition fails with recent kernel/dracut mithodin
` (2 preceding siblings ...)
2022-11-24 1:18 ` sgn
@ 2022-11-24 1:19 ` sgn
2022-11-25 7:48 ` mithodin
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: sgn @ 2022-11-24 1:19 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 417 bytes --]
New comment by sgn on void-packages repository
https://github.com/void-linux/void-packages/issues/40703#issuecomment-1325829883
Comment:
When you break into initramfs, please:
```sh
mkdir -p ${HOME}/.gnupg
echo "log-file /tmp/gpg.log" >>/tmp/gpg.conf
echo "log-file /tmp/gpg-agent.log" >>/tmp/gpg-agent.conf
gpgconf --kill gpg-agent
```
After that, try to decrypt the luks key again, then show us the log.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Decrypting key for luks root partition fails with recent kernel/dracut
2022-11-22 21:26 [ISSUE] Decrypting key for luks root partition fails with recent kernel/dracut mithodin
` (3 preceding siblings ...)
2022-11-24 1:19 ` sgn
@ 2022-11-25 7:48 ` mithodin
2022-11-25 8:03 ` classabbyamp
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: mithodin @ 2022-11-25 7:48 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 396 bytes --]
New comment by mithodin on void-packages repository
https://github.com/void-linux/void-packages/issues/40703#issuecomment-1327120668
Comment:
Sorry, it turns out I'm a dumbass. I didn't notice before that the device that holds the keys does not show up with the new kernel version. It's a micro sd card and with the working initramfs it shows up as /dev/mmcblk0, but not with the newer kernel.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Decrypting key for luks root partition fails with recent kernel/dracut
2022-11-22 21:26 [ISSUE] Decrypting key for luks root partition fails with recent kernel/dracut mithodin
` (4 preceding siblings ...)
2022-11-25 7:48 ` mithodin
@ 2022-11-25 8:03 ` classabbyamp
2022-11-25 8:54 ` mithodin
2022-11-25 8:54 ` [ISSUE] [CLOSED] " mithodin
7 siblings, 0 replies; 9+ messages in thread
From: classabbyamp @ 2022-11-25 8:03 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 364 bytes --]
New comment by classabbyamp on void-packages repository
https://github.com/void-linux/void-packages/issues/40703#issuecomment-1327131918
Comment:
something changed in a recent version that made emmc storage not show up anymore, for some reason. see here: https://old.reddit.com/r/voidlinux/comments/y03b8b/baytrail_stopped_booting_after_updating_to_519/isgg847/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Decrypting key for luks root partition fails with recent kernel/dracut
2022-11-22 21:26 [ISSUE] Decrypting key for luks root partition fails with recent kernel/dracut mithodin
` (5 preceding siblings ...)
2022-11-25 8:03 ` classabbyamp
@ 2022-11-25 8:54 ` mithodin
2022-11-25 8:54 ` [ISSUE] [CLOSED] " mithodin
7 siblings, 0 replies; 9+ messages in thread
From: mithodin @ 2022-11-25 8:54 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 391 bytes --]
New comment by mithodin on void-packages repository
https://github.com/void-linux/void-packages/issues/40703#issuecomment-1327173650
Comment:
@classabbyamp that's it. It's fixed :-D Thank you!
For anyone else looking for a solution: Add a file named mmc.conf (could be or any other name you like) in /etc/dracut.conf.d/ with these contents:
```
add_drivers+=" mmc_core mmc_block "
```
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [ISSUE] [CLOSED] Decrypting key for luks root partition fails with recent kernel/dracut
2022-11-22 21:26 [ISSUE] Decrypting key for luks root partition fails with recent kernel/dracut mithodin
` (6 preceding siblings ...)
2022-11-25 8:54 ` mithodin
@ 2022-11-25 8:54 ` mithodin
7 siblings, 0 replies; 9+ messages in thread
From: mithodin @ 2022-11-25 8:54 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1777 bytes --]
Closed issue by mithodin on void-packages repository
https://github.com/void-linux/void-packages/issues/40703
Description:
### Is this a new report?
Yes
### System Info
Void 5.19.10_1 x86_64 GenuineIntel uptodate rrFFFFFFFF
### Package(s) Affected
linux-6.0_1, dracut-053_5, gnupg-2.3.8_1
### Does a report exist for this bug with the project's home (upstream) and/or another distro?
_No response_
### Expected behaviour
gnupg is used at boot time to decrypt a key that is configured via the grub commandline with rd.luks.key to decrypt my root filesystem.
### Actual behaviour
The root filesystem fails to decrypt because the key file fails to decrypt.
### Steps to reproduce
1. Create a small partition holding a gpg-encrypted key file "root.key.gpg" for the root drive, which is luks encrypted
2. Put the private key capable of decrypting this key onto a yubikey.
3. Configure dracut to use this key at boot time via the grub commandline rd.luks.key=/root.key.gpg:UUID=<root fs UUID>
4. Add add_dracutmodules+=" crypt-gpg " to /etc/dracut.conf
5. Boot the computer with the yubikey plugged in
I have an initramfs with linux-5.19.10_1 where the process works fine. It used to work fine for many kernel versions, in fact. But starting with linux-5.19.15, the decryption fails. The root cause seems to be that gpg fails to decrypt the key file. On the rescue shell, I have confirmed that
- gpg is able to access the yubikey (gpg --card-status lists it and gpg --edit-card shows the properties correctly)
- gpg fails to decrypt the key file, giving only the message "unexpected error". Adding --verbose yields no additional information.
I'm at a loss where to go from here. I'm not even sure which of the involved components introduced the failure.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-11-25 8:54 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-22 21:26 [ISSUE] Decrypting key for luks root partition fails with recent kernel/dracut mithodin
2022-11-23 1:30 ` sgn
2022-11-23 7:07 ` mithodin
2022-11-24 1:18 ` sgn
2022-11-24 1:19 ` sgn
2022-11-25 7:48 ` mithodin
2022-11-25 8:03 ` classabbyamp
2022-11-25 8:54 ` mithodin
2022-11-25 8:54 ` [ISSUE] [CLOSED] " mithodin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).