Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lGQKu-0000UE-A2 for mharc-grub-devel@gnu.org; Sun, 28 Feb 2021 12:58:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGQKs-0000RY-PF for grub-devel@gnu.org; Sun, 28 Feb 2021 12:58:30 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33099) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lGQKk-0006dl-Id for grub-devel@gnu.org; Sun, 28 Feb 2021 12:58:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614535101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hrd+xbEyLOtuyfaIrQUzeQ07uxNQbXm4+HTCPOg6akQ=; b=IV7sML0A8Y49gv1mb3P90AlrkLz7cLk3SULxyykF4eP/l1uSFBy5C6tiW90Mp/1OyqEVnS w+6I80+EaNgAQX6lJf+9jpC2kmX47RVr1qTKib/nEDDHRVy7uMUw6XARkFG23kmHY2RDxo xQHmAZajLZhfb6WG4dn852G76NkdrLk= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-531-tCm4Ba_ZPCyeDbOFMLtpFw-1; Sun, 28 Feb 2021 12:58:19 -0500 X-MC-Unique: tCm4Ba_ZPCyeDbOFMLtpFw-1 Received: by mail-wr1-f69.google.com with SMTP id r12so4041687wro.15 for ; Sun, 28 Feb 2021 09:58:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=hrd+xbEyLOtuyfaIrQUzeQ07uxNQbXm4+HTCPOg6akQ=; b=esRqYds9U5dc/mELsAPEpVcMCc8v/gji0j326D0rr4q6Y9Hxc8k5HRfy+ORHnPHvzH C7mSrT9gyP4C3pIoAr+SR1Wtaai6lL+/M2RqDMYDRRFjMeXThxwZqo3YfYLoxdztM/36 kUm7efYuIuYzkfbSXc/4xkaMUgaUI7efyD19wrG1tkt1dChGdhiiM6pKNdfGuV0kcaQp +Rd3fnp6wq5xu6VoId3PRY4SHxDF8Gh+ksvZz4Sz2BtGQskAhPYO2FrSJ1TpETNfWUgv 7nfGg3AlakvVkzzJo4HmR9n1e7M/CRCvG9otDi+5+6lI7q35036IUUGeSSNthtbBfHha 1BRA== X-Gm-Message-State: AOAM530kRuQd83N5NAd8rajHMp/cSjROPm/DngxxLfCrGj3kNCemjJY/ RmzqZWldt8YyvBceUlb8JFRmCxzaWXyIEjXvG6t/8R3D4PAh08nTMrKBSHCmYk32/L40ptI3gzt 9Z819glMlS80= X-Received: by 2002:adf:ed44:: with SMTP id u4mr12755638wro.35.1614535098095; Sun, 28 Feb 2021 09:58:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzEu0TZbU+Sv+yY5fn+bd+8+X49ldP1nRzEWDgzJeE+3lSxNbXDrYscgrlqVJg1IYkF685zUg== X-Received: by 2002:adf:ed44:: with SMTP id u4mr12755626wro.35.1614535097916; Sun, 28 Feb 2021 09:58:17 -0800 (PST) Received: from [192.168.1.101] ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id z188sm12858712wme.32.2021.02.28.09.58.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 28 Feb 2021 09:58:17 -0800 (PST) From: Javier Martinez Canillas Subject: Re: [PATCH] tpm: Don't propagate measurement failures to the verifiers layer To: James Bottomley , The development of GNU GRUB Cc: Daniel Kiper References: <20210227230505.2024714-1-javierm@redhat.com> Message-ID: <93969746-c4e2-15a0-775e-7221043f2c7f@redhat.com> Date: Sun, 28 Feb 2021 18:58:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=216.205.24.124; envelope-from=javierm@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.248, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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 17:58:31 -0000 [re-sending since I got a 'Recipient server unavailable or busy' error, sorry if someone gets this email twice] Hello James, On 2/28/21 8:10 AM, James Bottomley wrote: > On Sun, 2021-02-28 at 00:05 +0100, Javier Martinez Canillas wrote: >> Currently if an EFI firmware fails to do a TPM measurement for a >> file, the error will be propagated to the verifiers framework which >> will prevent it to be opened. >> >> This mean that buggy firmwares will lead to the system not booting >> because files won't be allowed to be loaded. But a failure to do a >> TPM measurement isn't expected to be a fatal error that causes the >> system to be unbootable. >> >> To avoid this, don't return errors from .write and .verify_string >> callbacks and just print a debug message in the case of a TPM >> measurement failure. > > This does seem somewhat the wrong response. For everyone who is doing > measured boot, this will cause a complete break of the verification > chain. It looks like this is likely the fault of the bios vendor, so 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. It's up to attestation software to check that and not be enforced by the bootloaders in my opinion. As far as I can tell there is nothing in the TCG specs that mention that a failure to measure should prevent a system to boot. For me this is just a by-product of using the verifier framework as a way to hook the TPM measurements into the file open path. It's not really a verification, buffers passed aren't validated like with other verifiers. > why not push it back to source by failing the boot rather than > deferring the problem so it lands on the measured boot implementors. > > This looks like a simple fault in the UEFI vendor (likely insufficient > log space), can't you simply force the motherboard OEM to issue a fix > rather than adding a work around to the open source project that first > detects it. > You are looking through the lenses of the people doing trusted boot but what about those who are not? For them, they just updated GRUB and now the machine doesn't boot. They don't care or might even know what a TPM is, they just want to boot their OS. And in many cases the faulty firmware is from a vendor that doesn't even provide firmware updates or at least doesn't provide them through LVFS. So now the user (who can't boot their machine) has to report the issue, wait for a firmware fix and figure out a way to update it. For my this is not acceptable and quite antisocial for users. > James > > Best regards, -- Javier Martinez Canillas Software Engineer - Desktop Hardware Enablement Red Hat