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

Fix kexec_unload failure on secure boot enabled platforms #55

Closed
wants to merge 1 commit into from

Conversation

vivekrnv
Copy link
Owner

Why I did

kexec -u on systems with SB enabled is failing

root@sn5600:/home/admin# mokutil --sb-state
SecureBoot enabled
root@sn5600:/home/admin# kexec -u
kexec unload failed: Permission denied

[ 3443.199576] ima: impossible to appraise a kernel image without a file descriptor; try using kexec_file_load syscall.

How I did it

How to verify it

Use the -a argument with kexec

 -a, --kexec-syscall-auto  Use file based syscall for kexec and fall
                      back to the compatibility syscall when file based
                      syscall is not supported or the kernel did not
                      understand the image

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

@vivekrnv
Copy link
Owner Author

@davidpil2002 please review

@davidpil2002
Copy link

we use this flag when calling this function
function load_kernel() {
# Load kernel into the memory
invoke_kexec -a
}
do this solution to unload looks good to me as well

Copy link

@davidpil2002 davidpil2002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my comment in notes

@vivekrnv vivekrnv closed this Jul 23, 2024
@vivekrnv vivekrnv deleted the fix_kexec_unload branch August 6, 2024 01:09
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

Successfully merging this pull request may close these issues.

2 participants