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

sha512 signed modules not works #266

Closed
misterhsp opened this issue Oct 26, 2022 · 8 comments · Fixed by #274 or #278
Closed

sha512 signed modules not works #266

misterhsp opened this issue Oct 26, 2022 · 8 comments · Fixed by #274 or #278

Comments

@misterhsp
Copy link

Modules signed with the dkms-3.0.8 are rejected and I end up at the prompt of initramfs. In my case zfs-modul. The modules are signed but not accepted. Neither with my own keys nor the ones created by dkms. I am using Debian SID

The reason for this can be found in the following line.

eval '"$sign_file" sha512 "$mok_signing_key" "$mok_certificate" "$built_module"'

Here I get hash_algo sha512 signed which doesn't work on my box and my
laptop. If I change this to sha256 secure-boot works as desired. Why
this is so I can not say, this is beyond my knowledge. Also if this is a
bug or not I can't say.

Sorry for my crap english :-)

...

@evelikov
Copy link
Collaborator

What is the error message that you see as result of the above line? What distribution/version are you running?

@misterhsp
Copy link
Author

misterhsp commented Oct 26, 2022 via email

@xuzhen
Copy link
Collaborator

xuzhen commented Oct 26, 2022

There is a kconfig option for the hash algorithm of module signature. grep CONFIG_MODULE_SIG_HASH /boot/config-$(uname -r)

dkms should follow that option, or at least add a hash configuration in framework.conf.

@misterhsp
Copy link
Author

misterhsp commented Oct 26, 2022 via email

@evelikov
Copy link
Collaborator

evelikov commented Oct 26, 2022

Pulled https://packages.debian.org/sid/kernel/linux-config-6.0 and confirmed that CONFIG_MODULE_SIG_HASH is "sha256".

@xuzhen bear in mind the config is not guaranteed to live in /boot/config-XXX, is in /usr/lib/modules/uanme_a/build/.config as mentioned in #269.

Personally I would not add any more framework.conf options - parsing the kernel config should just work 🤞

@misterhsp
Copy link
Author

misterhsp commented Oct 27, 2022 via email

@misterhsp
Copy link
Author

misterhsp commented Nov 4, 2022

I have of course immediately tried with the new commit and must say it is still signed with sha512 here with me. secure-boot not possible.

modinfo zfs
filename: /lib/modules/6.0.0-2-amd64/updates/dkms/zfs.ko
version: 2.1.6-2
license: CDDL
author: OpenZFS
description: ZFS
alias: devname:zfs
alias: char-major-10-249
srcversion: 1DEFB8EF3D6F74821DBEA8E
depends: spl,icp,zavl,znvpair,zcommon,zlua,zzstd,zunicode
retpoline: Y
name: zfs
vermagic: 6.0.0-2-amd64 SMP preempt mod_unload modversions
sig_id: PKCS#7
signer: HSP Secure Boot CA
sig_key: 3A:DA:00:31:90:EF:E3:6C:2E:1E:94:87:E1:A4:6A:59:A3:D7:8E:EE
sig_hashalgo: sha512
signature: 9D:84:49:C2:B4:86:CB:79:07:CC:4D:2E:EB:3B:E5:BA:B0:86:F7:A8:
13:AD:80:31:EB:5D:07:68:DF:3F:00:6F:DB:73:50:C8:98:08:43:53:
3D:7C:DB:C0:0E:BA:A3:88:A3:24:27:EC:6D:CF:8E:47:6C:E7:FD:AE:
16:46:98:C6:77:22:DE:C0:D4:03:A5:A3:04:C0:B9:91:E3:C5:F3:D8:
3D:C8:B7:5E:E0:CF:F8:92:E0:57:29:2F:AB:FD:E8:57:F2:E1:C1:CD:
98:34:07:84:F2:BD:C0:84:D4:F3:0A:AA:36:F9:AE:FC:32:1B:AA:4C:
DD:4F:21:BC:B8:87:82:AE:9B:4D:FB:1C:07:69:CC:40:9F:07:CC:E7:
F2:75:98:D0:9E:FD:08:47:01:AF:17:D9:98:CE:80:ED:01:7A:A4:6E:
A9:A2:1A:0A:E7:CD:33:3E:AD:53:B0:30:07:26:D5:1A:FC:48:6A:8D:
FB:53:FF:0A:79:61:C4:26:BC:7A:4A:55:CD:FD:E0:5D:E1:98:EF:25:
D0:AF:44:76:80:9C:EF:2A:38:AE:88:51:EF:41:D1:EA:4D:0C:43:08:
7D:B1:E1:78:CF:41:8B:AB:76:7E:22:57:06:E3:C6:FB:D8:A8:4B:05:
64:13:4C:43:46:8B:AB:19:84:0C:AD:67:4D:2D:5A:C6

@misterhsp
Copy link
Author

Thanks for the quick fix. Now it works.

...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants