Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lGVR6-0007UE-Sj for mharc-grub-devel@gnu.org; Sun, 28 Feb 2021 18:25:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGVR1-0007SZ-VY for grub-devel@gnu.org; Sun, 28 Feb 2021 18:25:12 -0500 Received: from bedivere.hansenpartnership.com ([2607:fcd0:100:8a00::2]:34034) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGVQx-0008H8-2h for grub-devel@gnu.org; Sun, 28 Feb 2021 18:25:11 -0500 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 2236B1280562; Sun, 28 Feb 2021 15:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1614554705; bh=SS1eO9cVb4AEQDU9jhWwLbnEQ3yyxbaOvN682w4iro8=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=ChNV8tQe3NjBBIpSCmedZ/fQgOiWJ68YtuWWc+x20LoNDAWjsvnedxTWN8KJVwfWb Rq33qjBtOp+Ai+MTWHuRyGqC+7BKrJU++SvPUBsDMlmvw8xMGvSTrqfxbQvM0IREE9 u84PVDZjpz5Mgn07U/9IRygtrzDmw+JS1gWBlrmA= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5yOD6SWpZf6o; Sun, 28 Feb 2021 15:25:05 -0800 (PST) Received: from jarvis.int.hansenpartnership.com (unknown [IPv6:2601:600:8280:66d1::527]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id BA2E6128055D; Sun, 28 Feb 2021 15:25:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1614554704; bh=SS1eO9cVb4AEQDU9jhWwLbnEQ3yyxbaOvN682w4iro8=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=vNFgCvDJBuLjYvlHjv1Rxd2P1KtOIidybLaz9lWBk7c7d/J/woPssBww3QmhPUNXH I3sGgQzHS0JIodEc54s3JntM9MzKfWxoS79HglUuiH09jHo/pmUHapeX6U7UIAsA5F SLTFzUZel5883nYPIdm662AkVBH7QxLZZEo60Ois= Message-ID: <83a5b3c5230f5bfce88ee89a3f37bd7d06de3a03.camel@HansenPartnership.com> Subject: Re: [PATCH] tpm: Don't propagate measurement failures to the verifiers layer From: James Bottomley To: The development of GNU GRUB Cc: Daniel Kiper Date: Sun, 28 Feb 2021 15:25:04 -0800 In-Reply-To: References: <20210227230505.2024714-1-javierm@redhat.com> <93969746-c4e2-15a0-775e-7221043f2c7f@redhat.com> <7e7ff4df4f7829787387e18d33b13e0f990eed0f.camel@HansenPartnership.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:fcd0:100:8a00::2; envelope-from=James.Bottomley@HansenPartnership.com; helo=bedivere.hansenpartnership.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Feb 2021 23:25:14 -0000 On Sun, 2021-02-28 at 23:42 +0100, Javier Martinez Canillas wrote: > On 2/28/21 7:25 PM, James Bottomley wrote: > > On Sun, 2021-02-28 at 18:58 +0100, Javier Martinez Canillas wrote: > > [snip] > > > > I don't see how that would be the case. For anyone doing measured > > > boot, they can check the TPM event log to verify what has been > > > measured during the boot path. > > > > No, they can't ... that's the point, the log will no longer verify > > because of the failure. That's why this is a break in the > > measurement > > Yes, my point was that the attestation software can verify if there > are any gaps in the TPM logs due the failure to measure the boot > components. Right, but there's no way to match the log pieces to any value in the PCRs: that's why verification fails. > > chain. If you're requesting verified boot, which is an opt-in by > > inserting the TPM grub module, this is an unrecoverable failure. > > > > But it's not really optional, since most distros disable module > loading in GRUB if Secure Boot is enabled. Instead, a curated list of > modules are built-in the signed EFI binary. The tpm module is one of > these that we include in Fedora. Heh, well, don't get me started on how the different distributions package grub differently ... it would be really nice if everyone could agree on the right, or at least reasonable, way of doing it. However, my understanding, from having to do an annoying amount of boot debugging on various systems, is that you all package the grub elements to somewhere in the host root fileystem. Then you have a grub installer which picks the necessary elements out of the root filesystem and installs them in the EFI partition, which may or may not be permanently mounted. The problem, as you see it, is that the EFI version of grub-mkimage creates a unitary PE/COFF binary which consists of the core plus the curated modules and which must be secure boot signed in its entirety. This signed unitary binary is usually what is installed by the grub installer. The reason you don't like modules for secure boot is that the grub module system, at present, is unsigned and thus violates the secure boot trust model which requires all code executed in the boot sequence to be approved either by the machine owner or the software supplier. Incorporating a module signature system, like the kernel has, is orders of magnitude more effort than you want to invest in external patching, and likely would take several developer lifetimes to get upstream. Hopefully, I have all this right so far? How about a more simple solution: you sign two grub unitary EFI binaries, one of which does measured boot and one of which doesn't. Your installer is already config file driven, so by default it would install the measured boot one, but if there's a failure you can tell the user to add the config option to install the unmeasured boot one ... this could also be useful for various other situations where you want secure but not measured boot? I'm fairly certain you could design a distro installer test for the problem and thus always install a working system. There's no security issue because anyone who does attested measured boot will instantly detect someone booting via the signed unmeasured boot grub. Note: I'm certainly not presenting this as the optimal solution, merely the least effort solution that looks like it will work with the current grub upstream. James