Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp490847pxb; Thu, 19 Aug 2021 04:38:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKItgVcEEOYY8hugeV+38hMrSGmsWQ6+1IA5GmnU6OWVeA2810nofDVgth6Q0IrQRAjm+7 X-Received: by 2002:a17:906:f190:: with SMTP id gs16mr15451996ejb.439.1629373125779; Thu, 19 Aug 2021 04:38:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629373125; cv=none; d=google.com; s=arc-20160816; b=xjiR/VoThIWTjVww04mpG6Dg3BONe2WsFF2TJhe8zRN6ijrw4sfgaRHTke1wUh2+3S O3bvJ3foAtP15K1w9aL1XHknUOkb6V90bjmL+pnDvbDdalsem1kkyaLTQo+L51o5zwIl ls1igpVXLV0ARqckrjpjonZE7I9w3TmBQ+7/De1NWWfDHiAU4le/dg9jhbFmqUY5arxp /k4knpzMmb0LfyJUzEoaXR1kRZQnMO4SWodzQiailJ3f9A1yMFHLR329tOMtM4mHVP3X XdtBTuoMzpebttK5putvrgOD1oEcAxglOi78QKE/c3+Q0O86fCMf73S/NLTKdwjXhbvA ZEWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=jBqZmxOPEpfuIHEfnKvDUZurojhW5BMwmXrsVUma5yQ=; b=o+6Bav2uNmWBlDXojhr6fOxR9P0ducE+flTmDa0xP6UP52IV3fQomjNM4l+HepWY5e F3oMfIgEK1aXGn1p3uqmNXVOmuf+VLH9TFnJetyQWoHiHFUycSbW4ZWlutFqF8d5KVas C92pwOQlH/AROkGSG+8qjMxBEnQ0mtiup80VixGa7zYqAmzjq+URtqg92e226sMDLIO7 UKa2KzI4ZrjZ5Q0hxeNTNVp+sFKxJjIqS2kdh+f/jXBM997wiWOAMOeZwRzerIKYvM7M hfROHK63zGPDWyB/5MYPg8zhyVqPqJC0HV1I52wWaaE4bygwb58zC4ilLKcTfW2vq0Wq I+fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HUowvtbQ; 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 g3si3009113edw.18.2021.08.19.04.38.09; Thu, 19 Aug 2021 04:38:45 -0700 (PDT) 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=HUowvtbQ; 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 S238781AbhHSLim (ORCPT + 99 others); Thu, 19 Aug 2021 07:38:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:59800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238276AbhHSLim (ORCPT ); Thu, 19 Aug 2021 07:38:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6B14A61152; Thu, 19 Aug 2021 11:38:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629373085; bh=ztpTlKzDLnuXMkA6oqHi+0cvd0vo10eKEycotaJ9HBo=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=HUowvtbQtFmr68GYqsmFe38XS4JsbnrsAO+F4q2I/tDtZxtgQILgLJgEGc8+f/Cz0 uF8Ubu3FSMm8ezSeqFodFen4pHy/m4q7VrYbBct6Y4SEymSKzj6Ufc0u6kb/BloHFa MNKWa+cD49KUeXPOK2WvNvhKTeS4nY7kv459yxcJCmdrIjGQNsbN6JQW9LXGzt7e5x DCqe9yLWhvphgQGYiAXRUF2OM+ATZbvmlXeBM0j6DsYeRI1WNrXDDynv6Y36TLEC73 djxJnjdAtPzSGGtrluo65CZd6rhR/zah6L6wG7Bi9S4MCc3W8RtGmGe3gc9AFPs+6B w2BNLl0YwdGqw== Message-ID: Subject: Re: [PATCH v4 00/12] Enroll kernel keys thru MOK From: Jarkko Sakkinen To: Eric Snowberg , keyrings@vger.kernel.org, linux-integrity@vger.kernel.org, zohar@linux.ibm.com, dhowells@redhat.com, dwmw2@infradead.org, herbert@gondor.apana.org.au, davem@davemloft.net, jmorris@namei.org, serge@hallyn.com Cc: keescook@chromium.org, gregkh@linuxfoundation.org, torvalds@linux-foundation.org, scott.branden@broadcom.com, weiyongjun1@huawei.com, nayna@linux.ibm.com, ebiggers@google.com, ardb@kernel.org, nramas@linux.microsoft.com, lszubowi@redhat.com, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-security-module@vger.kernel.org, James.Bottomley@HansenPartnership.com, pjones@redhat.com, konrad.wilk@oracle.com Date: Thu, 19 Aug 2021 14:38:03 +0300 In-Reply-To: <20210819002109.534600-1-eric.snowberg@oracle.com> References: <20210819002109.534600-1-eric.snowberg@oracle.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, 2021-08-18 at 20:20 -0400, Eric Snowberg wrote: > Many UEFI Linux distributions boot using shim. The UEFI shim provides > what is called Machine Owner Keys (MOK). Shim uses both the UEFI Secure > Boot DB and MOK keys to validate the next step in the boot chain. The > MOK facility can be used to import user generated keys. These keys can > be used to sign an end-user development kernel build. When Linux boots, > pre-boot keys (both UEFI Secure Boot DB and MOK keys) get loaded in the > Linux .platform keyring. =20 >=20 > Currently, pre-boot keys are not trusted within the Linux trust boundary > [1]. These platform keys can only be used for kexec. If an end-user > wants to use their own key within the Linux trust boundary, they must > either compile it into the kernel themselves or use the insert-sys-cert > script. Both options present a problem. Many end-users do not want to > compile their own kernels. With the insert-sys-cert option, there are > missing upstream changes [2]. Also, with the insert-sys-cert option, > the end-user must re-sign their kernel again with their own key, and > then insert that key into the MOK db. Another problem with > insert-sys-cert is that only a single key can be inserted into a > compressed kernel. >=20 > Having the ability to insert a key into the Linux trust boundary opens > up various possibilities. The end-user can use a pre-built kernel and > sign their own kernel modules. It also opens up the ability for an > end-user to more easily use digital signature based IMA-appraisal. To > get a key into the ima keyring, it must be signed by a key within the > Linux trust boundary. As of today, I can use a prebuilt kernel, crate my own MOK key and sign modules. What will be different? > Downstream Linux distros try to have a single signed kernel for each > architecture. Each end-user may use this kernel in entirely different > ways. Some downstream kernels have chosen to always trust platform keys > within the Linux trust boundary for kernel module signing. These > kernels have no way of using digital signature base IMA appraisal. >=20 > This series introduces a new Linux kernel keyring containing the Machine > Owner Keys (MOK) called .mok. It also adds a new MOK variable to shim. I would name it as ".machine" because it is more "re-usable" name, e.g. could be used for similar things as MOK. ".mok" is a bad name because it binds directly to a single piece of user space software. /Jarkko