Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1340814ybp; Thu, 17 Oct 2019 11:18:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0phrPWJwSy0xsRCowjN7T6zGd1v5tsHIIxM4G32st2yHv/YserZJDk1s5IqHmne2VGw6A X-Received: by 2002:a17:906:4895:: with SMTP id v21mr308826ejq.2.1571336310852; Thu, 17 Oct 2019 11:18:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571336310; cv=none; d=google.com; s=arc-20160816; b=mIJ2bNZ9W+/oH14MaDGpWHiZwWzo1w86WwLU+WsQWyWW3ZybrRJYhwU0eXHBkaqX8R UYO7KqrQ2lx76B3TsbBoWtc9/CEsnDapGt4y1S0r7BKClr0WtnD0cBlZUz13ZwTMXDSx S+RtUqXUR7tr3OJOv4lYkDpkXzOvGgo1OrMRZ1wsNPqvsSO0t1qvQWV3tAOQpm3UN9nq KZ40rALtHsecV0A60mgG/Ru2H8nCYiiwBxAXj612i1aookao0r9UP4HdN7l1W9FYy7zM tGuzNX0ZwAhn1sm34bA+PydzrFihUHKWkd7LXJDl2XPCaWcE0hsOz/MH4ofikHzrCPt8 8zXQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uf/kPmGZ1mI7BA/tX5lEsT2ze7Kwz8P8CVkG5Y6jGVA=; b=bPXHy++H9S/6Us2Ec1Radwlr25KvRBL0GjYCG+pKPG88vEBAMCqgwTn9epRSxTcRor bq6JzaHp1wa3ykxLvzFYBGO8YWBUOZ0ZIV+i3/D/Sbo7IMU5Lfz5rpLDiXkLw//JyCNV 25LWtnT2AX2W/jCwRBTQ+CAu+NxYk/lELw2pLagqY4wooHvggKvmd0R4g/DiGE/6nFQ3 pPYZg/OiMvpeyi7sHx3KWge4YuzHKH3ZMx1LoeZT0ssVGmRbncRZbvG/3SeYFguskTmJ liQIk0w7gCCcLwb+jYfkT0CO0eTnKsTVT7MZAMRdMeRmwYQS9eP0xYKDoJ8uHD71mgnI TURg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1lGijWaR; 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 e11si1921832ejr.383.2019.10.17.11.18.07; Thu, 17 Oct 2019 11:18:30 -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; dkim=pass header.i=@kernel.org header.s=default header.b=1lGijWaR; 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 S2391903AbfJPWAC (ORCPT + 99 others); Wed, 16 Oct 2019 18:00:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:53068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404003AbfJPV7A (ORCPT ); Wed, 16 Oct 2019 17:59:00 -0400 Received: from localhost (unknown [192.55.54.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CB93C20872; Wed, 16 Oct 2019 21:58:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571263139; bh=IBDqXUFTgvbXNtgLNo86W8OOy+sVrhGFPMnCyefn4gQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1lGijWaR5W7UTOBc8W9DUqk8PIlsdiUmnai0zzDrJIXL4+3nlt1XbqKjQdl47wLMF rA5dh6XEyHf7XidWUWniQwfvkdDitqdI3XK15MtX9n9YDHEUMbDzZZ5paM9GaDyEY+ lYP0i5h7weEybKsY2dCYZrg7iobiSfq4Gsaev/AQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Scott Talbert , Ard Biesheuvel , Ben Dooks , Dave Young , Jarkko Sakkinen , Jerry Snitselaar , Linus Torvalds , Lukas Wunner , Lyude Paul , Matthew Garrett , Octavian Purdila , Peter Jones , Peter Zijlstra , Thomas Gleixner , linux-efi@vger.kernel.org, linux-integrity@vger.kernel.org, Ingo Molnar Subject: [PATCH 5.3 062/112] efivar/ssdt: Dont iterate over EFI vars if no SSDT override was specified Date: Wed, 16 Oct 2019 14:50:54 -0700 Message-Id: <20191016214900.840734790@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191016214844.038848564@linuxfoundation.org> References: <20191016214844.038848564@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel commit c05f8f92b701576b615f30aac31fabdc0648649b upstream. The kernel command line option efivar_ssdt= allows the name to be specified of an EFI variable containing an ACPI SSDT table that should be loaded into memory by the OS, and treated as if it was provided by the firmware. Currently, that code will always iterate over the EFI variables and compare each name with the provided name, even if the command line option wasn't set to begin with. So bail early when no variable name was provided. This works around a boot regression on the 2012 Mac Pro, as reported by Scott. Tested-by: Scott Talbert Signed-off-by: Ard Biesheuvel Cc: # v4.9+ Cc: Ben Dooks Cc: Dave Young Cc: Jarkko Sakkinen Cc: Jerry Snitselaar Cc: Linus Torvalds Cc: Lukas Wunner Cc: Lyude Paul Cc: Matthew Garrett Cc: Octavian Purdila Cc: Peter Jones Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Cc: linux-integrity@vger.kernel.org Fixes: 475fb4e8b2f4 ("efi / ACPI: load SSTDs from EFI variables") Link: https://lkml.kernel.org/r/20191002165904.8819-3-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- drivers/firmware/efi/efi.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -282,6 +282,9 @@ static __init int efivar_ssdt_load(void) void *data; int ret; + if (!efivar_ssdt[0]) + return 0; + ret = efivar_init(efivar_ssdt_iter, &entries, true, &entries); list_for_each_entry_safe(entry, aux, &entries, list) {