From patchwork Mon Oct 14 17:21:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Snitselaar X-Patchwork-Id: 11189221 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CC7D614DB for ; Mon, 14 Oct 2019 17:21:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B7F7620873 for ; Mon, 14 Oct 2019 17:21:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729997AbfJNRVr (ORCPT ); Mon, 14 Oct 2019 13:21:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48130 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726637AbfJNRVr (ORCPT ); Mon, 14 Oct 2019 13:21:47 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1005B18C4279; Mon, 14 Oct 2019 17:21:47 +0000 (UTC) Received: from cantor.redhat.com (ovpn-116-190.phx2.redhat.com [10.3.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA5F65D6A9; Mon, 14 Oct 2019 17:21:46 +0000 (UTC) From: Jerry Snitselaar To: linux-kernel@vger.kernel.org Cc: Ard Biesheuvel , Jarkko Sakkinen , linux-efi@vger.kernel.org, linux-integrity@vger.kernel.org, Dan Carpenter Subject: [PATCH] efi/tpm: return -EINVAL when determining tpm final events log size fails Date: Mon, 14 Oct 2019 10:21:45 -0700 Message-Id: <20191014172145.9669-1-jsnitsel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Mon, 14 Oct 2019 17:21:47 +0000 (UTC) Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org Currently nothing checks the return value of efi_tpm_eventlog_init, but in case that changes in the future make sure an error is returned when it fails to determine the tpm final events log size. Cc: Ard Biesheuvel Cc: Jarkko Sakkinen Cc: linux-efi@vger.kernel.org Cc: linux-integrity@vger.kernel.org Fixes: e658c82be556 ("efi/tpm: Only set 'efi_tpm_final_log_size' after successful event log parsing") Suggested-by: Dan Carpenter Signed-off-by: Jerry Snitselaar Reviewed-by: Jarkko Sakkinen --- drivers/firmware/efi/tpm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c index ebd7977653a8..31f9f0e369b9 100644 --- a/drivers/firmware/efi/tpm.c +++ b/drivers/firmware/efi/tpm.c @@ -88,6 +88,7 @@ int __init efi_tpm_eventlog_init(void) if (tbl_size < 0) { pr_err(FW_BUG "Failed to parse event in TPM Final Events Log\n"); + ret = -EINVAL; goto out_calc; }