Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5508476ybp; Tue, 8 Oct 2019 04:06:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxu+ROSNJrZJC2Iw+AFOLBGrCsMTdW0E03e/0XSH/wrWIhRnpuVfdQh2zm/50O+kb4vQguc X-Received: by 2002:a50:9402:: with SMTP id p2mr33465230eda.111.1570532789845; Tue, 08 Oct 2019 04:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570532789; cv=none; d=google.com; s=arc-20160816; b=H2oUYyLvp0q4pxFaAOazox3za5oVY/FfBin2CESqpreHXClDIgNZ14gZbVzKSSAKHj NCK5l6VKp/syzEDsJ47M1ZZQ+38MK4NZRiSw3jj9xpPMlIYvFqOpWH2QoquXu8nROVFH OsFGfDegrYoP+PmGdaIWvoZ999IOtf06k8gpFECXQPlYiq12Q2CUnZ8h3guyuD/+zR5V MxCfoJydJGmRMYgKZcTi8avFA5iEM2FAFg3S5sVnBXBd3vx9NzJZYX++Jac6PD8RYOWO +E0TFOUzVIw1GKSz7MdWqYoWm8OTo7TdiJIVhGJT2OOggNygED6YfAWOUPnpVf966kV/ S3gw== 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 :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=hYsTdUjywYiCETX5omnGZXY6cmSt7DL2hLzUzM41h3I=; b=MIDU3D2BO7XPMOseRQN4xhlilI1uItWhTcaoOg67pdvRXHrG3Czt30ItphcmYdUEx1 rVBI27S1GSqVyjbC36weiT1KjMMvfW4y5/EC0ehg4cvdUy+jelvCLBN7nFiL/74ppYk6 9I59WA2xLx/4iZDp43sBPH7Nt7VomPXzvE5lpaym2JLXar95EoBc40X2UMNetpzSSQJV t2ZOtRPtwVBxBZqsArfgBYvunfD5WuJMPZcHD2UsO1vZYuqqmUwb0tyw7w9gGO0L5j3I sI3yBewFgXAeSf3gO36Uzlx0SIUC16VxcMW8KhJ74WwHGFbH+VYQFpjVAHHz13rxf2Os qxbQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c54si10297915edb.230.2019.10.08.04.05.58; Tue, 08 Oct 2019 04:06:29 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730566AbfJHLF0 (ORCPT + 99 others); Tue, 8 Oct 2019 07:05:26 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:47755 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730118AbfJHLFZ (ORCPT ); Tue, 8 Oct 2019 07:05:25 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iHnIt-0007nn-Su; Tue, 08 Oct 2019 13:05:20 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 78CEA1C0325; Tue, 8 Oct 2019 13:05:19 +0200 (CEST) Date: Tue, 08 Oct 2019 11:05:19 -0000 From: "tip-bot2 for Colin Ian King" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: efi/urgent] efi/tpm: Fix sanity check of unsigned tbl_size being less than zero Cc: Colin Ian King , Ard Biesheuvel , Jerry Snitselaar , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , kernel-janitors@vger.kernel.org, linux-efi@vger.kernel.org, Ingo Molnar , Borislav Petkov , linux-kernel@vger.kernel.org In-Reply-To: <20191008100153.8499-1-colin.king@canonical.com> References: <20191008100153.8499-1-colin.king@canonical.com> MIME-Version: 1.0 Message-ID: <157053271938.9978.4783819046234300891.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org 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: be59d57f98065af0b8472f66a0a969207b168680 Gitweb: https://git.kernel.org/tip/be59d57f98065af0b8472f66a0a969207b168680 Author: Colin Ian King AuthorDate: Tue, 08 Oct 2019 11:01:53 +01:00 Committer: Ingo Molnar CommitterDate: Tue, 08 Oct 2019 13:01:09 +02:00 efi/tpm: Fix sanity check of unsigned tbl_size being less than zero Currently the check for tbl_size being less than zero is always false because tbl_size is unsigned. Fix this by making it a signed int. Addresses-Coverity: ("Unsigned compared against 0") Signed-off-by: Colin Ian King Cc: Ard Biesheuvel Cc: Jerry Snitselaar Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: kernel-janitors@vger.kernel.org Cc: linux-efi@vger.kernel.org Fixes: e658c82be556 ("efi/tpm: Only set 'efi_tpm_final_log_size' after successful event log parsing") Link: https://lkml.kernel.org/r/20191008100153.8499-1-colin.king@canonical.com Signed-off-by: Ingo Molnar --- drivers/firmware/efi/tpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c index 703469c..ebd7977 100644 --- a/drivers/firmware/efi/tpm.c +++ b/drivers/firmware/efi/tpm.c @@ -40,7 +40,7 @@ int __init efi_tpm_eventlog_init(void) { struct linux_efi_tpm_eventlog *log_tbl; struct efi_tcg2_final_events_table *final_tbl; - unsigned int tbl_size; + int tbl_size; int ret = 0; if (efi.tpm_log == EFI_INVALID_TABLE_ADDR) {