From: James Bottomley <James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
To: "Lee,
Chun-Yi" <joeyli.kernel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: linux-fs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "Lee,
Chun-Yi" <jlee-IBi9RG/b67k@public.gmane.org>,
Josh Boyer
<jwboyer-rxtnV0ftBwyoClj4AeEUq9i2O/JbrIOy@public.gmane.org>
Subject: Re: [PATCH 1/4] MODSIGN: do not load mok when secure boot disabled
Date: Thu, 30 Nov 2017 07:51:03 -0800 [thread overview]
Message-ID: <1512057063.3020.11.camel@HansenPartnership.com> (raw)
In-Reply-To: <20171129141139.20088-2-jlee-IBi9RG/b67k@public.gmane.org>
On Wed, 2017-11-29 at 22:11 +0800, Lee, Chun-Yi wrote:
> The mok can not be trusted when the secure boot is disabled. Which
> means that the kernel embedded certificate is the only trusted key.
>
> Due to db/dbx are authenticated variables, they needs manufacturer's
> KEK for update. So db/dbx are secure when secureboot disabled.
>
> Cc: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Cc: Josh Boyer <jwboyer-rxtnV0ftBwyoClj4AeEUq9i2O/JbrIOy@public.gmane.org>
> Signed-off-by: "Lee, Chun-Yi" <jlee-IBi9RG/b67k@public.gmane.org>
> ---
> certs/load_uefi.c | 26 +++++++++++++++-----------
> 1 file changed, 15 insertions(+), 11 deletions(-)
>
> diff --git a/certs/load_uefi.c b/certs/load_uefi.c
> index 3d88459..d6de4d0 100644
> --- a/certs/load_uefi.c
> +++ b/certs/load_uefi.c
> @@ -164,17 +164,6 @@ static int __init load_uefi_certs(void)
> }
> }
>
> - mok = get_cert_list(L"MokListRT", &mok_var, &moksize);
> - if (!mok) {
> - pr_info("MODSIGN: Couldn't get UEFI MokListRT\n");
> - } else {
> - rc = parse_efi_signature_list("UEFI:MokListRT",
> - mok, moksize,
> get_handler_for_db);
> - if (rc)
> - pr_err("Couldn't parse MokListRT signatures:
> %d\n", rc);
> - kfree(mok);
> - }
> -
> dbx = get_cert_list(L"dbx", &secure_var, &dbxsize);
> if (!dbx) {
> pr_info("MODSIGN: Couldn't get UEFI dbx list\n");
> @@ -187,6 +176,21 @@ static int __init load_uefi_certs(void)
> kfree(dbx);
> }
>
> + /* the MOK can not be trusted when secure boot is disabled
> */
> + if (!efi_enabled(EFI_SECURE_BOOT))
> + return 0;
> +
> + mok = get_cert_list(L"MokListRT", &mok_var, &moksize);
This isn't really a criticism of your patch but the underlying: all of
the *RT variables, like MokListRT are insecure runtime variables and
can be tampered with. I can agree that I can't see a tamper attack
between exit boot services and pulling this in to the key list, but I'd
feel a lot happier if the values were obtained directly from the BS
variable before exit boot services because that's means the path for
getting the values is directly within the secure envelope and doesn't
rely on passing via an insecure element.
James
next prev parent reply other threads:[~2017-11-30 15:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-29 14:11 [PATCH 0/4] Using the hash in MOKx to blacklist kernel module Lee, Chun-Yi
2017-11-29 14:11 ` [PATCH 1/4] MODSIGN: do not load mok when secure boot disabled Lee, Chun-Yi
[not found] ` <20171129141139.20088-2-jlee-IBi9RG/b67k@public.gmane.org>
2017-11-30 15:51 ` James Bottomley [this message]
[not found] ` <1512057063.3020.11.camel-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
2017-12-01 6:59 ` joeyli
2017-11-29 14:11 ` [PATCH 2/4] MODSIGN: print appropriate status message when getting UEFI certificates list Lee, Chun-Yi
[not found] ` <20171129141139.20088-1-jlee-IBi9RG/b67k@public.gmane.org>
2017-11-29 14:11 ` [PATCH 3/4] MODSIGN: load blacklist from MOKx Lee, Chun-Yi
2017-11-29 14:11 ` [PATCH 4/4] MODSIGN: checking the blacklisted hash before loading a kernel module Lee, Chun-Yi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1512057063.3020.11.camel@HansenPartnership.com \
--to=james.bottomley-d9phhud1jfjcxq6kfmz53/egyhegw8jk@public.gmane.org \
--cc=dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=jlee-IBi9RG/b67k@public.gmane.org \
--cc=joeyli.kernel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=jwboyer-rxtnV0ftBwyoClj4AeEUq9i2O/JbrIOy@public.gmane.org \
--cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-fs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox