Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4472491pxv; Tue, 20 Jul 2021 04:40:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjhuMEhW981+rjrkCwS4DKy+XFatRg1+lsE7x08vNj/Cd58i3ZgykokeKthn2EkdijjNtt X-Received: by 2002:a05:6638:58e:: with SMTP id a14mr21359324jar.81.1626781250258; Tue, 20 Jul 2021 04:40:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626781250; cv=none; d=google.com; s=arc-20160816; b=bmhnavPPyQ211Iks20wIQlZgLfXUMEuReyJfxxZpAF32WuvR/cBCC2K+5i+90Ylawr OQvGGGj6VKPeHieC5uiKHsXvwLabR9fenXvXmakqOyim3jEnhcf9kt7xhnsgM1SqncAX A9CLMgVqkYkpreV8ORBT8U11kS3FQYEsFBKFZJ5TOpjL9Cq+/nqx9wtJs9eJQ2lMEsSn CMk6HMZlOtCyYaH+gXx0NDI/V5kY3OYWusE55teLHr028V7/qkFDMMHibOdE3pMyblVL 14h8eLlgu+SpJSqJiUI28jeIr7u6dXZ/13mDvqDUonKeYylu5CTEoRWo10ozrO98RW2F ZmRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=MDGMmPbtbF5/H2yZEINtmGA18N7ewwPqc7Ot/cO5wR4=; b=cppjWEY4/wDX28dozbPBMYOO03t4QGg0aBJ6CH7Hfak0b1XMp83qJWM7mtN2Po0YGZ 2lNLY2D7pSmoAVf38yg/WFr5XllSGxTSmHyklmwMVI80MkqWK5Yu8b8Fs0NFDrIHj0yu OYun5uSVXAD7BOM7Ug0zlWxAaLWphjVcB1szOLiWVeMk2KQhruU9zLtE860/Uyyq/2Wg 1ezPCUnuDqbo1RIa9EYZ3uK1AJYefYBceafs8GKixqjfxKs1jMzv2UjDiixpj5ayMMUI igc5HY8W/xOvXo5YEOPAAsUOtgw1ujv/meosRidEjNIvw9P9uIQvpVAnbraqnkIUBrzR iOYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3uEAyQct; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=NeDyEnVu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r6si27750702iov.48.2021.07.20.04.40.39; Tue, 20 Jul 2021 04:40:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linutronix.de header.s=2020 header.b=3uEAyQct; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=NeDyEnVu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236461AbhGTK5p (ORCPT + 99 others); Tue, 20 Jul 2021 06:57:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234895AbhGTK45 (ORCPT ); Tue, 20 Jul 2021 06:56:57 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3FD4C0613DC; Tue, 20 Jul 2021 04:37:22 -0700 (PDT) Date: Tue, 20 Jul 2021 11:37:19 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1626781040; h=from:from:sender:sender:reply-to: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; bh=MDGMmPbtbF5/H2yZEINtmGA18N7ewwPqc7Ot/cO5wR4=; b=3uEAyQctMglA9Y8tUO8SASl8SVGABTGrkFFoLCJNo2cwiu/LGtZhYTzHaa1nJfXbFafJdl TrI2WHmk71tP/JaDznyVM4Jy/NWASYqVU7+Dlu+mt6xTSCDhawOuyw7IfMYaByFfqEu5Q9 n64BUdvXxBKQlrwqsa9JwLa1JEpJgMklCe6QkrFSGzMuC+AoFptKcDBRRHUgP/E2Ep7nms MTDdVRv0fzvxU9vDV2MdNOXtY+ywa9O8nZsrccnpEQxkEjZ+2Q6z4Puf/uHzkhvTuQesG8 pgpm8sIFwrTbS3GPLsz2wfJCR9RW5hnbz9xSqIrtI8HhOnKiVmSu/hkdP6wV9g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1626781040; h=from:from:sender:sender:reply-to: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; bh=MDGMmPbtbF5/H2yZEINtmGA18N7ewwPqc7Ot/cO5wR4=; b=NeDyEnVuQdMWPO1Aur9cOsCXyiOHhE1drc9liEzhu0n7W5o7n9kfw4Z8YSIl6LKErzl/JQ JmVOx4Rtkwbd3bDA== From: "tip-bot2 for Michal Suchanek" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: efi/urgent] efi/tpm: Differentiate missing and invalid final event log table. Cc: Michal Suchanek , Jarkko Sakkinen , Ard Biesheuvel , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <162678103984.395.15219402725448409606.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the efi/urgent branch of tip: Commit-ID: 674a9f1f6815849bfb5bf385e7da8fc198aaaba9 Gitweb: https://git.kernel.org/tip/674a9f1f6815849bfb5bf385e7da8fc198aaaba9 Author: Michal Suchanek AuthorDate: Thu, 08 Jul 2021 11:46:54 +02:00 Committer: Ard Biesheuvel CommitterDate: Fri, 16 Jul 2021 18:04:55 +02:00 efi/tpm: Differentiate missing and invalid final event log table. Missing TPM final event log table is not a firmware bug. Clearly if providing event log in the old format makes the final event log invalid it should not be provided at least in that case. Fixes: b4f1874c6216 ("tpm: check event log version before reading final events") Signed-off-by: Michal Suchanek Reviewed-by: Jarkko Sakkinen Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/tpm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c index c1955d3..8f66567 100644 --- a/drivers/firmware/efi/tpm.c +++ b/drivers/firmware/efi/tpm.c @@ -62,9 +62,11 @@ int __init efi_tpm_eventlog_init(void) tbl_size = sizeof(*log_tbl) + log_tbl->size; memblock_reserve(efi.tpm_log, tbl_size); - if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR || - log_tbl->version != EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) { - pr_warn(FW_BUG "TPM Final Events table missing or invalid\n"); + if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR) { + pr_info("TPM Final Events table not present\n"); + goto out; + } else if (log_tbl->version != EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) { + pr_warn(FW_BUG "TPM Final Events table invalid\n"); goto out; }