This patch allows the kexec_file_load syscall to verify the PE signed kernel image signature based on the preboot keys stored in the .platform keyring, as fall back, if the signature verification failed due to not finding the public key in the secondary or builtin keyrings. This commit adds a VERIFY_USE_PLATFORM_KEYRING similar to previous VERIFY_USE_SECONDARY_KEYRING indicating that verify_pkcs7_signature should verify the signature using platform keyring. Also, decrease the error message log level when verification failed with -ENOKEY, so that if called tried multiple time with different keyring it won't generate extra noises.
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -17,6 +17,7 @@ · 16 unmodified lines | |||
| 17 | * should be used. | 17 | * should be used. |
| 18 | */ | 18 | */ |
| 19 | #define VERIFY_USE_SECONDARY_KEYRING ((struct key *)1UL) | 19 | #define VERIFY_USE_SECONDARY_KEYRING ((struct key *)1UL) |
| 20 | #define VERIFY_USE_PLATFORM_KEYRING ((struct key *)2UL) | ||
| 20 | 21 | ||
| 21 | /* | 22 | /* |
| 22 | * The use to which an asymmetric key is being put. | 23 | * The use to which an asymmetric key is being put. |