Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3673079pxv; Mon, 26 Jul 2021 09:08:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQffgiSd9TM1u3pev7PyKuvq606BhC8Qj3/XGRKYwj71zVl+I7mL/CyvEVNlLLOV5AEui/ X-Received: by 2002:a92:ae03:: with SMTP id s3mr13000821ilh.51.1627315713073; Mon, 26 Jul 2021 09:08:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627315713; cv=none; d=google.com; s=arc-20160816; b=l0STiwdR6Bq+bTMap1eeW/8zZypiMblTwzedeAB8/Yz98JRBk7Lt7EU4T0hcAMHLfQ OYggQPjtDnYzVomkD/lv093cPzQ3/Jk404Zi4S81jI7MhdZ9/zYscFvG27cCNWmT3etg 7dxA2/yVD/y4oxlCmliuncw+Jb07jtfjd9/xczNuoKVvJJsaD5RA16nVVkjrFwvBfB0N 7WC4e5AkQzvNG53x9REkaowu6TyPCT5Li9FJqIczBXodq9jx6NnUvDwuxsVpbhybirLW T7WsbDN+p3rsjMVgyp+WITXj57obFunX1CAY8Z62peiErkitryUtNW1Jnasyb1d8VZfg O43w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=atGPLwg1QsER61sjGGILUj6PeIfJYJHpEhyqlJb06CM=; b=k2fQqRA79JY1UbIPa6c+NqID2SJLOkDyx/sgAxzfU0o4ntwoMZUvDxuAgybjpfvj7n 4Y62jA3phvKTFcRamb0Fa87euxIv9i7lq0WdIQyRl2G4bJeBxi2ewRkmnctd4eOv16PG HB01TYVpsRN/mZ9b3C4w8uL9CrX/q+7g7F4U7+GUG5rV82cDU6nGmhAH9OtIep5EULtU PwnBjjr2M60QlwY+KCYuj2jqqXtZbQ86ymBxXKSWOjd1aBt+UKrdzvk6ic+SuMTuKPoj lq2X7eA2hpKB3k2DqIdPkheB9SGdoldMJ0NLIN1sXLU8g2N0vWknxcyR8AHmIL1sTxPD k09g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=whgi+s00; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i3si253520ilu.3.2021.07.26.09.08.21; Mon, 26 Jul 2021 09:08:33 -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=@linuxfoundation.org header.s=korg header.b=whgi+s00; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237556AbhGZPXh (ORCPT + 99 others); Mon, 26 Jul 2021 11:23:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:55556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237506AbhGZPP4 (ORCPT ); Mon, 26 Jul 2021 11:15:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 54CB060F02; Mon, 26 Jul 2021 15:56:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627314983; bh=cgH073LWw0eTXV3+ESWoNu9JY4+Ou+SLK4vjGfJL7Ys=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=whgi+s00QQoRAijHWnPY2oM/c3lqwIj9FgH/2GHL0R9hSEG7HBnvW0iwTXxuNzUjE slFzauClSTvKjley+nTX4AATDM/WmWfUyxfPz/lItRmbUvGbl7gW9LCYVEYMh5iX+H 4sh6hGbrNtQjTPr/f4iJk1RIgcA1o8Pqn5fHc9oQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michal Suchanek , Jarkko Sakkinen , Ard Biesheuvel , Sasha Levin Subject: [PATCH 5.4 042/108] efi/tpm: Differentiate missing and invalid final event log table. Date: Mon, 26 Jul 2021 17:38:43 +0200 Message-Id: <20210726153833.041785623@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153831.696295003@linuxfoundation.org> References: <20210726153831.696295003@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Suchanek [ Upstream commit 674a9f1f6815849bfb5bf385e7da8fc198aaaba9 ] 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 Signed-off-by: Sasha Levin --- 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 c1955d320fec..8f665678e9e3 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; } -- 2.30.2