]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
integrity: ignore keys failing CA restrictions on non-UEFI platform
authorNayna Jain <nayna@linux.ibm.com>
Tue, 15 Aug 2023 11:27:18 +0000 (07:27 -0400)
committerJarkko Sakkinen <jarkko@kernel.org>
Thu, 17 Aug 2023 20:12:35 +0000 (20:12 +0000)
On non-UEFI platforms, handle restrict_link_by_ca failures differently.

Certificates which do not satisfy CA restrictions on non-UEFI platforms
are ignored.

Signed-off-by: Nayna Jain <nayna@linux.ibm.com>
Reviewed-and-tested-by: Mimi Zohar <zohar@linux.ibm.com>
Acked-by: Jarkko Sakkinen <jarkko@kernel.org>
Tested-by: Nageswara R Sastry <rnsastry@linux.ibm.com>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
security/integrity/platform_certs/machine_keyring.c

index 7aaed7950b6e3673fdb734ea1b13fa3db516cf76..389a6e7c92458ceb210b59b0c6784fcae5ba60c8 100644 (file)
@@ -36,7 +36,7 @@ void __init add_to_machine_keyring(const char *source, const void *data, size_t
         * If the restriction check does not pass and the platform keyring
         * is configured, try to add it into that keyring instead.
         */
-       if (rc && IS_ENABLED(CONFIG_INTEGRITY_PLATFORM_KEYRING))
+       if (rc && efi_enabled(EFI_BOOT) && IS_ENABLED(CONFIG_INTEGRITY_PLATFORM_KEYRING))
                rc = integrity_load_cert(INTEGRITY_KEYRING_PLATFORM, source,
                                         data, len, perm);