Fix kexec forbidding kernels signed with keys in the secondary keyring to boot
authorYannik Sembritzki <[email protected]>
Thu, 16 Aug 2018 13:05:23 +0000 (14:05 +0100)
committerLinus Torvalds <[email protected]>
Thu, 16 Aug 2018 16:57:20 +0000 (09:57 -0700)
The split of .system_keyring into .builtin_trusted_keys and
.secondary_trusted_keys broke kexec, thereby preventing kernels signed by
keys which are now in the secondary keyring from being kexec'd.

Fix this by passing VERIFY_USE_SECONDARY_KEYRING to
verify_pefile_signature().

Fixes: d3bfe84129f6 ("certs: Add a secondary system keyring that can be added to dynamically")
Signed-off-by: Yannik Sembritzki <[email protected]>
Signed-off-by: David Howells <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Linus Torvalds <[email protected]>
arch/x86/kernel/kexec-bzimage64.c

index 7326078eaa7a6518d30cb98d6443d507299c70c0..278cd07228dd886778cabf708dd2b1237a318d72 100644 (file)
@@ -532,7 +532,7 @@ static int bzImage64_cleanup(void *loader_data)
 static int bzImage64_verify_sig(const char *kernel, unsigned long kernel_len)
 {
        return verify_pefile_signature(kernel, kernel_len,
-                                      NULL,
+                                      VERIFY_USE_SECONDARY_KEYRING,
                                       VERIFYING_KEXEC_PE_SIGNATURE);
 }
 #endif