Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2577050ybl; Sun, 2 Feb 2020 01:41:51 -0800 (PST) X-Google-Smtp-Source: APXvYqy8xXIHCBN2dckyQawh5o9SG/34TU6XHH5QRGPxUno8XOiWech21mdfocR/FlIDHjZhLT70 X-Received: by 2002:a05:6830:10d7:: with SMTP id z23mr13703606oto.114.1580636511558; Sun, 02 Feb 2020 01:41:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580636511; cv=none; d=google.com; s=arc-20160816; b=Fc2pWoKHYKp7tSbAZuT/77P536RW4FteIIZis+P7m2PSmYZE77+JSQc5bQJ96vbylS SQhtpF7STC0/GOStCPwC2IhNW6bmo76Mm1c3NAeWn1mGsrYBqvb64TZUNPkK4FyQ/QFV T+7fitMgbYCe1oqzF6n//6xatrJ4gwK7lvlzTomH5l0FRCi0OyGcBn8WNKirsXvDdIJq tAZjw55lcSqaNOoGceGl/KHFgXFp7l3vn96BEuAmKwP8ABxWTbOpqcA5ugAPUdDw5PxV v5iQOowg+RjyhduDIvPYbhw9c5rNUqb6+hH6M2DIHv3M6TDSu1p5vYWyrmER9nXpowbj kAmQ== 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=uNy6+YpRfxEkaRix2ovS1RyQaLvo5LYdxir8zGTDXOI=; b=0X1qml06/fkp9n1CLHr13hkJHz3EqSevyCY7XjFOC6sQPiUacR3yuIfg1+t3QC8ow+ M41UyfK1/TAB+OlymruBDcyEnYI5pePFKG0agZOBIOd/ITlhMJpJSSbztZyXJG9mtIVi j5UfnnORKkBOZGMC/UiisKiD1Uroe1z8hsuKUADbYByi+X8OLdceECjHu9iZKkCYmC0q Ol26S357lopTkwACxvPCoqg8ADhTGU/phlHSzhAsztWSmZucYXol/Qn83FdzrfcMDBt7 IoyWX4p2KtCVy4IagsKq4z3y+HQHgB3dXq5VNH0kaIO+ElseoEqjAhS2EIWIW0fEXCGV m7fg== 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 m5si1542601oie.240.2020.02.02.01.41.39; Sun, 02 Feb 2020 01:41:51 -0800 (PST) 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 S1726561AbgBBJjt convert rfc822-to-8bit (ORCPT + 99 others); Sun, 2 Feb 2020 04:39:49 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:57746 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725942AbgBBJjs (ORCPT ); Sun, 2 Feb 2020 04:39:48 -0500 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 1iyBjA-0000MD-TY; Sun, 02 Feb 2020 10:39:41 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 384551C1CE2; Sun, 2 Feb 2020 10:39:40 +0100 (CET) Date: Sun, 02 Feb 2020 09:39:39 -0000 From: "tip-bot2 for Ard Biesheuvel" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: efi/urgent] efi/x86: Fix boot regression on systems with invalid memmap entries Cc: jrg.otte@gmail.com, Dan Williams , Ard Biesheuvel , Ingo Molnar , linux-efi@vger.kernel.org, torvalds@linux-foundation.org, x86 , LKML In-Reply-To: <20200201233304.18322-1-ardb@kernel.org> References: <20200201233304.18322-1-ardb@kernel.org> MIME-Version: 1.0 Message-ID: <158063637918.411.14525312464973256998.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: 8BIT 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: 59365cadfbcd299b8cdbe0c165faf15767c5f166 Gitweb: https://git.kernel.org/tip/59365cadfbcd299b8cdbe0c165faf15767c5f166 Author: Ard Biesheuvel AuthorDate: Sun, 02 Feb 2020 00:33:04 +01:00 Committer: Ingo Molnar CommitterDate: Sun, 02 Feb 2020 10:25:43 +01:00 efi/x86: Fix boot regression on systems with invalid memmap entries In efi_clean_memmap(), we do a pass over the EFI memory map to remove bogus entries that may be returned on certain systems. This recent commit: 1db91035d01aa8bf ("efi: Add tracking for dynamically allocated memmaps") refactored this code to pass the input to efi_memmap_install() via a temporary struct on the stack, which is populated using an initializer which inadvertently defines the value of its size field in terms of its desc_size field, which value cannot be relied upon yet in the initializer itself. Fix this by using efi.memmap.desc_size instead, which is where we get the value for desc_size from in the first place. Reported-by: Jörg Otte Tested-by: Jörg Otte Tested-by: Dan Williams Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Cc: linux-efi@vger.kernel.org Cc: jrg.otte@gmail.com Cc: torvalds@linux-foundation.org Cc: mingo@kernel.org Link: https://lore.kernel.org/r/20200201233304.18322-1-ardb@kernel.org --- arch/x86/platform/efi/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 59f7f6d..ae923ee 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -308,7 +308,7 @@ static void __init efi_clean_memmap(void) .phys_map = efi.memmap.phys_map, .desc_version = efi.memmap.desc_version, .desc_size = efi.memmap.desc_size, - .size = data.desc_size * (efi.memmap.nr_map - n_removal), + .size = efi.memmap.desc_size * (efi.memmap.nr_map - n_removal), .flags = 0, };