Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3009899imm; Sun, 1 Jul 2018 10:13:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdaWnQyFibB2JlH84CpsjOBxw5y8G8BnZAXUGdOYnnAMb0RuUhn85IMKBujMHa0FPPFHyIY X-Received: by 2002:aa7:83d1:: with SMTP id j17-v6mr22506490pfn.236.1530465221307; Sun, 01 Jul 2018 10:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530465221; cv=none; d=google.com; s=arc-20160816; b=MWupQtZ3zPRaz/c+W43GKj/Kz3GY3eaBPs1PKPFkqFfqQirQStnpWLbx30dvoJuPD8 1vaf2w8u3Eq6T/6zj2ngVzDLwhDtpdU2E4a5FrcOjGdbzMrr0s/FqrnTX087Yxfqj5n7 KZRk9mBzUqI5I6LFC6o5vSR/srwbZ9oOtJjrRRLoUXuhETqhlRkhhB4ya3moXAvFU41Y wQt4vUgX7SHd1FmZQfReI5f+Rpzx2yH/kxpWeBayrRhEdwAQAVhkkFtLWlFsA6qkEMjG lRc1wPhL+eYTAg+AQYReebBgiviU9jV68glJnbFwEqG70JoW8etPHodz/gf/Th04P0MI x+Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=I9QrPsWYRhKhD0b4R3nCDFtr7ZWEJBs2XM4a1o5UZR0=; b=kBzHWxHryiIBnRkh3kHMTYM3HpMeDA36JYl+iEpiM8gQuJhOL1MRyjM1KtxjINbAIm CE521Ruyi0IHkgUv/ZI75hg9ATwmtmZhDjZmrSFgHTemFx7RR9Tle3e0s7QF4oxTScQ3 xSitpaJaF7ZUJ6Vb/Fe4uMF0M0MkTm37qfSZnftT3Ez+WeeX/8xQsCZ9bWyWVeaKFrmm SlUiz2BMcsaOxSBhtkcHwqmcmt4AEso71f6vL4FUe3/UJ3O1idHhzcDkvlDxW4lvuVF8 HcvTQeu+Eaw+OwK4tC248KNVOOGI74PLgUfD/inJGyiTo291SZyk6SB9NmMf6gzmxKxf J7aw== 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 a20-v6si250038pgb.600.2018.07.01.10.13.27; Sun, 01 Jul 2018 10:13:41 -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 S1031907AbeGAQk3 (ORCPT + 99 others); Sun, 1 Jul 2018 12:40:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37156 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031881AbeGAQkS (ORCPT ); Sun, 1 Jul 2018 12:40:18 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 305CCACC; Sun, 1 Jul 2018 16:40:18 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Ard Biesheuvel , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , linux-efi@vger.kernel.org, Ingo Molnar Subject: [PATCH 4.17 083/220] efi/libstub/tpm: Initialize efi_physical_addr_t vars to zero for mixed mode Date: Sun, 1 Jul 2018 18:21:47 +0200 Message-Id: <20180701160911.897966940@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans de Goede commit 52e1cf2d19c2e62e6a81b8de3f7320d033917dd5 upstream. Commit: 79832f0b5f71 ("efi/libstub/tpm: Initialize pointer variables to zero for mixed mode") fixes a problem with the tpm code on mixed mode (64-bit kernel on 32-bit UEFI), where 64-bit pointer variables are not fully initialized by the 32-bit EFI code. A similar problem applies to the efi_physical_addr_t variables which are written by the ->get_event_log() EFI call. Even though efi_physical_addr_t is 64-bit everywhere, it seems that some 32-bit UEFI implementations only fill in the lower 32 bits when passed a pointer to an efi_physical_addr_t to fill. This commit initializes these to 0 to, to ensure the upper 32 bits are 0 in mixed mode. This fixes recent kernels sometimes hanging during early boot on mixed mode UEFI systems. Signed-off-by: Hans de Goede Signed-off-by: Ard Biesheuvel Cc: # v4.16+ Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180622064222.11633-2-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- drivers/firmware/efi/libstub/tpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/firmware/efi/libstub/tpm.c +++ b/drivers/firmware/efi/libstub/tpm.c @@ -64,7 +64,7 @@ void efi_retrieve_tpm2_eventlog_1_2(efi_ efi_guid_t tcg2_guid = EFI_TCG2_PROTOCOL_GUID; efi_guid_t linux_eventlog_guid = LINUX_EFI_TPM_EVENT_LOG_GUID; efi_status_t status; - efi_physical_addr_t log_location, log_last_entry; + efi_physical_addr_t log_location = 0, log_last_entry = 0; struct linux_efi_tpm_eventlog *log_tbl = NULL; unsigned long first_entry_addr, last_entry_addr; size_t log_size, last_entry_size;