Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4922160ybp; Mon, 14 Oct 2019 12:14:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqwl3eXwdduBnsSGSlDwmRfKMoov4bV5+gV8MGFdvyUlLITldwSrbbFUukF+h3WU+BSb5cRu X-Received: by 2002:a50:e40c:: with SMTP id d12mr29193294edm.256.1571080492766; Mon, 14 Oct 2019 12:14:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571080492; cv=none; d=google.com; s=arc-20160816; b=qDjgPh/1ERRJ0+Sl3q9MDLgYHHHBfAKn/OmmF5bGwSapdUgyoXY4CorzEKhJs8RwsC vYYEj1eoqUlYEQt24jr7n0tSlDLfSGrKyaTHv4vaDxLp6VNQPgukOyEESrGOh2XkK9Bu nmA7CkIEvb6Rqf0YSsveR4NDzasFhblufvVCZPep7t8aJX33mINLwbBJVOkU7GKkO+iv 6LrzZ4X+zxfNT/suAeN4s0i+6gflkZSpbjU1ItuX0f7kQ+6pSKbwUPm6xZOeqa2PNbVI aFJnWLNCfanZ4rXAITmcQaEuwto2asUkZGfATtmHL+lwv9ml1xirV1CCJtK2b2NNH2Jw g9mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ALqIlZkLlDAP9ajgjqWEtpT+QUxhRBeivaiNCfomKbU=; b=hgIJQ9+cuto9PnrrpMpTAu4KCoKw/T3Y/uv7/P+ThozW0pbWHLv9gdOvXnZUwqgyzP 98SzCJuoqD70V3OVKORP2FS82Qj01lZCBJJjx3ASSaJtWX+sndHS/KBCLGAp3Zzwchkk cSNZFcLWmf2V89cM96G6hbukt9fRT9TOBKIbXeYgT6ISHL7qWbVG8Y1cXBngn3v/o2DZ sS26A1yNXYR7AQyFIL5gEYwDU+KlJIpgQm68WhkTOjWXPfNmB0LavWHNjSpQM9otionx nRNVs2OEY7pFxW7ahT5YLXY9UurdgYxqkFUrMIHURixaIziBbyaXWJIEl5v6qnHRE04+ QxaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qh16si11942228ejb.349.2019.10.14.12.13.49; Mon, 14 Oct 2019 12:14:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388492AbfJNRVr (ORCPT + 99 others); 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 Content-Transfer-Encoding: 8bit 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- 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; } -- 2.23.0