-
Notifications
You must be signed in to change notification settings - Fork 73
Out-Of-Tree module fails to probe: "Required key not available" #79
Comments
When googling for Yocto/OE things, made sure to double-check the version of the results. The link you provide for the out-of-tree modules guide is from 1.4-daisy, over 4 years ago. I don't know if much has changed in this aspect of OE, but maybe the latest documentation helps? There has been some discussion on the yocto mailing list about signing, but I think that's mostly to do with u-boot and measured boot. |
@twoerner Thanks for catching that! I was definitely following the latest documentation when creating my out-of-tree module recipe, but just grabbed the wrong link when I googled this documentation without checking the version. Do you happen to know how the Linux kernel signs modules? Is it part of the |
@robbawebba Currently, the modsign feature available in meta-integrity completely depends on kernel build infrastructure (aka kbuild). meta-integrity provides a signing key, and kbuild will sign kernel module with the signing tool scripts/sign-file during The usage of scripts/sign-file is:
Here is a manual step to sign a kernel module with meta-secure-core build on my box:
Check the signing result:
You will see a magic string " However, we still need an engineering solution to handle out-of-tree kernel module in SDK and build infrastructure. |
Hi @jiazhang0, Sorry for the delay! I had and idea on how to implement this and would like your feedback. The overall solution that came to mind is a bbclass called So the Makefile for the out-of-tree module would need to include this target. Here's an example borrowed from meta-skeleton/recipes-kernel/hello-mod:
@jiazhang0 Please let me know if you have any thoughts on this approach! I plan on creating an example of this bbclass to test this, so I'll let you know how it works out. If you don't mind, I am pretty interested in adding this enhancement to meta-secure-core. Thanks in advance! |
@robbawebba This sounds good. You can even define a new meta-skeleton for meta-secure-core to do this. |
@jiazhang0 Thanks! Also, are there any special details I should consider when contributing this change? For example, what branch should be the destination branch of my PR? master, Sumo, or Rocko? |
@robbawebba The master branch is good enough. I will cherry-pick your commit to other stable branches. |
Any luck on this? Using make modules_sign doesn't seem to work as the recipe will run in the kbuild directory, and the key is not there. Trying to find a usable reference to the directory where the key is generated to reference it and use sign-file manually is not obvious to me, still looking for a way to do it. |
Hi @bluca, It's been quite some time since I worked on this issue unfortunately. I took a stab at the |
Commenting here as this is the result returned by Google for "yocto sign out of tree kernel module": I was able to sign out of tree kernel modules by adding |
Hi @yadutaf is it working the same with self-generated keys i.e configuring CONFIG_MODULE_SIG_KEY="certs/my_key.pem" |
Hello!
I'm have an out-of-tree kernel module that I'm including in my image. I'm following the out-of-tree modules guide that's included in the Yocto kernel development manual to include it properly in my build.
I get the following error when trying to probe this module:
I have the
modsign
andima
distro features enabled and I'm includinglinux-yocto-integrity.inc
in my kernel recipe. I would expect this error for a module that I did not build with the rest of my image, but this module was built as a recipe along with my kernel, so I was hoping this module would also be signed.Would it be possible to append the
module.bbclass
class that's provided by OpenEmbedded Core to include a module signing task? If not, would the correct approach be to create a newsigned-module.bbclass
that inherits frommodule.bbclass
that includes the signing step?I was trying to hack on this idea last night but I'm unfamiliar with how to sign kernel modules. Thanks for your help!
The text was updated successfully, but these errors were encountered: