[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210916221922.xjplaobua2iss2bn@redhat.com>
Date: Thu, 16 Sep 2021 18:19:22 -0400
From: Peter Jones <pjones@...hat.com>
To: Eric Snowberg <eric.snowberg@...cle.com>
Cc: keyrings@...r.kernel.org, linux-integrity@...r.kernel.org,
zohar@...ux.ibm.com, dhowells@...hat.com, dwmw2@...radead.org,
herbert@...dor.apana.org.au, davem@...emloft.net,
jarkko@...nel.org, jmorris@...ei.org, serge@...lyn.com,
keescook@...omium.org, gregkh@...uxfoundation.org,
torvalds@...ux-foundation.org, scott.branden@...adcom.com,
weiyongjun1@...wei.com, nayna@...ux.ibm.com, ebiggers@...gle.com,
ardb@...nel.org, nramas@...ux.microsoft.com, lszubowi@...hat.com,
linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org,
linux-security-module@...r.kernel.org,
James.Bottomley@...senPartnership.com, konrad.wilk@...cle.com
Subject: Re: [PATCH v6 12/13] integrity: Trust MOK keys if MokListTrustedRT
found
On Tue, Sep 14, 2021 at 05:14:15PM -0400, Eric Snowberg wrote:
> +/*
> + * Try to load the MokListTrustedRT UEFI variable to see if we should trust
> + * the mok keys within the kernel. It is not an error if this variable
> + * does not exist. If it does not exist, mok keys should not be trusted
> + * within the machine keyring.
> + */
> +static __init bool uefi_check_trust_mok_keys(void)
> +{
> + efi_status_t status;
> + unsigned int mtrust = 0;
> + unsigned long size = sizeof(mtrust);
> + efi_guid_t guid = EFI_SHIM_LOCK_GUID;
> + u32 attr;
> +
> + status = efi.get_variable(L"MokListTrustedRT", &guid, &attr, &size, &mtrust);
This should use efi_mokvar_entry_find("MokListTrustedRT") instead,
similar to how load_moklist_certs() does. It's a *much* more reliable
mechanism. We don't even need to fall back to checking for the
variable, as any version of shim that populates this supports the config
table method.
--
Peter
Powered by blists - more mailing lists