Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lGQzc-0004NK-0y for mharc-grub-devel@gnu.org; Sun, 28 Feb 2021 13:40:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGQzX-0004MV-6O for grub-devel@gnu.org; Sun, 28 Feb 2021 13:40:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:22443) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lGQzS-0004Mp-CH for grub-devel@gnu.org; Sun, 28 Feb 2021 13:40:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614537625; 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=jCz2h1Qpccj/tEdwY7YZKqSBY2Bxo/tJeCnl57odWN0=; b=GTNj/smG3AY47DTTSDs42pz/X/gOxGfE0CMasSVgnDeMGSl6D8nzZTXAwwZdM1/7dCtd/e qtn1M0yuR2+ADo+USf8VpoPeb+INF2CKCAUbIXEhN6Y/NyUQ5ROT9bEdShySFLMWzFJPZT w2uCPo5fmVgRxvrzmS0NqN5XcWv3p5g= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-500-aohzT3xFNTCMeykCy_zg8Q-1; Sun, 28 Feb 2021 08:38:15 -0500 X-MC-Unique: aohzT3xFNTCMeykCy_zg8Q-1 Received: by mail-wr1-f70.google.com with SMTP id h30so7905094wrh.10 for ; Sun, 28 Feb 2021 05:38:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jCz2h1Qpccj/tEdwY7YZKqSBY2Bxo/tJeCnl57odWN0=; b=SN8/I1+Ws+nLE/GbnDHmug99ijT25y63xGjFr1WEPx9iOYnNBCGNiRzdAG78dk+Q1P y0yY+Z2sTidJoKCat7tbmizqfl3liFuPfOKcKX8V27aQ0NoC89/72/cTLy5TILR++kHD Mf4toSzQFWcQ/x1Cbw+SaRvutmPsAdz5wRv+fxPb6WmgGgI26VAAx7PNtJ+D+prCQci0 2EOFGd4RUfCppejBH1yjfHXiWEnTcC5sMiKK7EFV8o3sYchNcULxWA+ahpsLITFYb/V0 9v6XZ8DKepGeMXWC/w6WxHGfMml9qIVv0jHiw1ce4ge5/pktGhY4npcxpZzZ9R3h1kLA oZ3w== X-Gm-Message-State: AOAM530gL/41tB6b8RMhKMVQwW2iNhNEwLMBqu1mKGz1RE879ipQ2OkL NyUOCTPxl7XR0ob+hnAakVtUuiFlDYGlpHZ/hkRA+IWGJ05FF1rqwttxvi9WyV2977q2qZQrSls wn3jUVKJfCa0= X-Received: by 2002:a5d:67c8:: with SMTP id n8mr5025677wrw.351.1614519494281; Sun, 28 Feb 2021 05:38:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6IHvv6t3BqfMYiDhUn33tuRlevDYedBVZN9oRImZKgKasdlewZYHnx2FnLz/H7UcAQ3foEA== X-Received: by 2002:a5d:67c8:: with SMTP id n8mr5025586wrw.351.1614519492469; Sun, 28 Feb 2021 05:38:12 -0800 (PST) Received: from [192.168.1.101] ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id m17sm18251033wmq.5.2021.02.28.05.38.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 28 Feb 2021 05:38:12 -0800 (PST) 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> From: Javier Martinez Canillas Message-ID: Date: Sun, 28 Feb 2021 14:38:10 +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=63.128.21.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_H4=-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 18:40:35 -0000 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