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

help: how to load kernel module without disable the lockdown #5831

Open
zhuizhuhaomeng opened this issue Jul 14, 2023 · 4 comments
Open

help: how to load kernel module without disable the lockdown #5831

zhuizhuhaomeng opened this issue Jul 14, 2023 · 4 comments

Comments

@zhuizhuhaomeng
Copy link

We need to load the kernel module developed by ourselves.
But when we can not load the module by insmod cmd, the error message is:

insmod: ERROR: could not insert module lkm_example.ko: Operation not permitted

I have tried to sign the kernel module, but mokutil returns error:

$ mokutil --import MOK.der
EFI variables are not supported on this system

I really appreciate any help you can provide.

@elsaco
Copy link

elsaco commented Jul 14, 2023

@zhuizhuhaomeng to use mokutil the system must be booted in uefi mode. Check if /sys/firmware/efi is present.

@zhuizhuhaomeng
Copy link
Author

@elsaco there are not /sys/firmware/efi present.
Are there any way to load my own ko?

@mfrw
Copy link
Member

mfrw commented Jul 21, 2023

/cc @christopherco

@zcobol
Copy link

zcobol commented Jul 28, 2023

@zhuizhuhaomeng the answer is here #4797 (comment)

Sample run:

zcobol@mariner [ ~/test ]$ mokutil --sb-state
SecureBoot enabled
zcobol@mariner [ ~/test ]$ sudo dmesg -C
zcobol@mariner [ ~/test ]$ sudo insmod hello-world.ko 
zcobol@mariner [ ~/test ]$ sudo dmesg
[ 1945.757062] Hello world
zcobol@mariner [ ~/test ]$ lsmod | grep hello
hello_world            16384  0
zcobol@mariner [ ~/test ]$ sudo rmmod hello_world
zcobol@mariner [ ~/test ]$ sudo dmesg
[ 1945.757062] Hello world
[ 1977.632256] bye bye kernel

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

No branches or pull requests

4 participants