Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2434043pxb; Sat, 30 Jan 2021 02:28:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJytc70VY5PApnwhrNnGa/JCgYw+sZmgvj8pG1ru+kQQ1Mg7MftlKkdGF94dgXNKxWEFqfqN X-Received: by 2002:a17:907:7255:: with SMTP id ds21mr8475304ejc.258.1612002491850; Sat, 30 Jan 2021 02:28:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612002491; cv=none; d=google.com; s=arc-20160816; b=hnqQkHiIhQ54+arjKf1wKuDwYFV41RyIksRMuS8DoLA+M1aQvLqqVjCD9LhE7WKyYt JGGygD1HL2asqrAWf943MdstsVpwqj0DqLkw4vqs0+8ltoiL5WF42ZPWHs2GgwGHobpu LYceovY1nb2dCgkip8Gc82Z6Trmuuyid+H4RgMQtofQ+hdcwknQfGnaCCzYkXkRVaBO4 bk5FSs6g9ixXHShsVOFjv8FhebTSry3jNgwzxZgj7yS92Du6e028klozfeaoQGzLGiGk YCnW1FDEexl0mvn9jKcU1LSgIy5yxXhNbiX9la9nraIVeM7a0m+7eUfwfb/NrOyOFzMI 3qQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fjKpOJOm+Rh+t/HtQc3Mt/J9EgLaNhbnpeQru5vIQ4k=; b=Ge+q+g85tgCRsjS5B/h9EJgU8YJRO5xqAMCv1euxwdPT+ssi5ntyu1w/ZkSJqd/H6Q ELynrKv9MguT+I9P+zKoDj7u+Az8CUM58n5vS5fmYxr7s3eXRvTVWQ0ApPaVFJ8CH96W HGDphfNuaTgBvrA6qKkaEVa2nHciOzQInQH32mwzFy8+XfAaMoQlgWOn6J1/g1IFI9pn ub1QYJDfwdbB7bA9BC7ilvxH6TEjwJ4Lkh8ERDzIMZufagDPxv3jqSj4XWCXFajI1nn3 G6d4Qsbv/vI8F6q88CvWZy6WLj/iboHj5wjU4jGSnMqs+loCv2NjySCsnu8wl9qkJtZF I6Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RVQ6JqkY; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j4si6637129edn.609.2021.01.30.02.27.36; Sat, 30 Jan 2021 02:28:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RVQ6JqkY; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232236AbhA3KZ2 (ORCPT + 99 others); Sat, 30 Jan 2021 05:25:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:51148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232199AbhA3KZ0 (ORCPT ); Sat, 30 Jan 2021 05:25:26 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0488964E05; Sat, 30 Jan 2021 10:24:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612002285; bh=JnBJ9yEVn7P1tBZKCOw6J2eaiEK2+XU3s7XI7eKmziI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RVQ6JqkYHMUPHoFe/qjI3k5FhKYLINAdkkZru1LeotSaLIitfKzlBcCYlcbSe3u03 jUnGlWulA31u9bfPAwef9yCP8w6sEJg+vdpTfibNqYG6c4Y1t3uQsni/Dqt8XFcn4h Dp5Q+4ub3EDyBo/ReZArE3N6q7ejXCdHxOT36anGLM/jAQ/gluLR88BbGqua8NxAgR 6iGdWCGljP3YaKFBlnQkg6c+VcoPGsJOH/OQo4tSBRajxAgbIc7DNX7d62crk2Qrq5 +ObWQZLLPtiZzJAa/6CaqUly0AehC+ti4B070xMhezW7pQV3nHMI1A6Iax/09AjFmO Mfo6jR9t++dMA== Date: Sat, 30 Jan 2021 12:24:40 +0200 From: Jarkko Sakkinen To: Eric Snowberg Cc: Mimi Zohar , David Howells , linux-integrity , Jarkko Sakkinen , dwmw2@infradead.org, herbert@gondor.apana.org.au, davem@davemloft.net, jmorris@namei.org, serge@hallyn.com, nayna@linux.ibm.com, erichte@linux.ibm.com, mpe@ellerman.id.au, keyrings@vger.kernel.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-security-module@vger.kernel.org, James.Bottomley@hansenpartnership.com Subject: Re: [PATCH v4] certs: Add EFI_CERT_X509_GUID support for dbx entries Message-ID: References: <2442460.1610463459@warthog.procyon.org.uk> <3063834.1611747971@warthog.procyon.org.uk> <61a0420790250807837b5a701bb52f3d63ff0c84.camel@linux.ibm.com> <86CE3924-E36F-44FD-A259-3CC7E69D3EAC@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <86CE3924-E36F-44FD-A259-3CC7E69D3EAC@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Jan 27, 2021 at 08:41:29AM -0700, Eric Snowberg wrote: > > > On Jan 27, 2021, at 7:03 AM, Mimi Zohar wrote: > > > > [Cc'ing linux-integrity] > > > > On Wed, 2021-01-27 at 11:46 +0000, David Howells wrote: > >> Jarkko Sakkinen wrote: > >> > >>>> I suppose a user space tool could be created. But wouldn’t what is > >>>> currently done in the kernel in this area need to be removed? > >>> > >>> Right. I don't think this was a great idea in the first place to > >>> do to the kernel but since it exists, I guess the patch does make > >>> sense. > >> > >> This information needs to be loaded from the UEFI tables before the system > >> starts loading any kernel modules or running any programs (if we do > >> verification of such, which I think IMA can do). > > > > There needs to a clear distinction between the pre-boot and post-boot > > keys. UEFI has its own trust model, which should be limited to UEFI. > > The .platform keyring was upstreamed and limited to verifying the kexec > > kernel image. Any other usage of the .platform keyring keys is > > abusing its intended purpose. > > > > The cover letter says, "Anytime the .platform keyring is used, the > > keys in the .blacklist keyring are referenced, if a matching key is > > found, the key will be rejected." I don't have a problem with loading > > the UEFI X509 dbx entries as long as its usage is limited to verifying > > the kexec kernel image. > > Correct, with my patch, when EFI_CERT_X509_GUID entries are found in the > dbx, they will only be used during kexec. I believe the latest dbx file on > uefi.org contains three of these entires. > > Based on my understanding of why the platform keyring was introduced, > I intentionally only used these for kexec. I do question the current > upstream mainline code though. Currently, when EFI_CERT_X509_SHA256_GUID > or EFI_CERT_SHA256_GUID entries are found in the dbx, they are applied > everywhere. It seems like there should be a dbx revocation keyring > equivalent to the current platform keyring that is only used for pre-boot. > > If that is a direction you would like to see this go in the future, let > me know, I’d be happy to work on it. I would tend to agree with this. /Jarkko