From patchwork Sat Mar 10 16:16:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Sakkinen X-Patchwork-Id: 10273705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E658D602BD for ; Sat, 10 Mar 2018 16:17:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7A4B29A8C for ; Sat, 10 Mar 2018 16:17:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC6C929A94; Sat, 10 Mar 2018 16:17:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D8AE29A8C for ; Sat, 10 Mar 2018 16:17:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932501AbeCJQQt (ORCPT ); Sat, 10 Mar 2018 11:16:49 -0500 Received: from mga18.intel.com ([134.134.136.126]:3557 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932329AbeCJQQr (ORCPT ); Sat, 10 Mar 2018 11:16:47 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Mar 2018 08:16:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,451,1515484800"; d="scan'208";a="40832262" Received: from avlasenk-mobl1.ger.corp.intel.com (HELO localhost) ([10.249.254.115]) by orsmga002.jf.intel.com with ESMTP; 10 Mar 2018 08:16:43 -0800 From: Jarkko Sakkinen To: linux-integrity@vger.kernel.org Cc: linux-security-module@vger.kernel.org, Sahil Rihan , Alexei Starovoitov , Jarkko Sakkinen , stable@vger.kernel.org, Peter Huewe , Jason Gunthorpe , Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] tpm: allow TCPA log area to be empty Date: Sat, 10 Mar 2018 18:16:37 +0200 Message-Id: <20180310161637.7723-1-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.15.1 Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP TCPA log are can be empty when the TPM is disabled. This commit changes the behavior of tpm_read_log_acpi() to return successfully in this case. Cc: stable@vger.kernel.org Fixes: 55a82ab3181b ("[PATCH] tpm: add bios measurement log") Signed-off-by: Jarkko Sakkinen Reported-by: Sahil Rihan Reported-by: Sahil Rihan Tested-by: Sahil Rihan --- drivers/char/tpm/tpm_eventlog_acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm_eventlog_acpi.c b/drivers/char/tpm/tpm_eventlog_acpi.c index 66f19e93c216..f5f66dcd6f30 100644 --- a/drivers/char/tpm/tpm_eventlog_acpi.c +++ b/drivers/char/tpm/tpm_eventlog_acpi.c @@ -84,8 +84,8 @@ int tpm_read_log_acpi(struct tpm_chip *chip) break; } if (!len) { - dev_warn(&chip->dev, "%s: TCPA log area empty\n", __func__); - return -EIO; + dev_info(&chip->dev, "TCPA log area is empty\n"); + return 0; } /* malloc EventLog space */