Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3487326imu; Sun, 11 Nov 2018 16:12:36 -0800 (PST) X-Google-Smtp-Source: AJdET5fS4JKv5CdiVm3K7+bnX/lUzuYZrj2fWDrPmKUTMkA/vBd2eCXqCqivj+3drW0WjPMkpJXe X-Received: by 2002:a63:413:: with SMTP id 19mr15405934pge.7.1541981556287; Sun, 11 Nov 2018 16:12:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981556; cv=none; d=google.com; s=arc-20160816; b=s/uTUe6I63ALp12DrV1ZOy5TBUou3XQqsOSlWF31kEICrbMipKof2SaaG9Y69iA3uW x6kDNw1hHbftwGKXIjEX9bOJCXMoOKZAUoXCVUr5NMg37+ZtV2LjWdAMKCNc6dMXhGBM z6qmcl6OZHo9YshO1TnJrmbUfn/hf4L6qG4MLhbRQpKowBNF99TDtXhdb6kTZ3AmMTO5 crjjx1xHpuZK+yqhxblkllDGYrgdGz8Y3DpC0uNbZWZN4hmThtmPvdNCiVHZYb5TcwL1 kJ/uLxEpbc3dtKmNJV7N4v1mzrLLUx1kt9MnJaiIaGkGBBmyTbXWNAUYGizRe1ym1BRb 8Xpw== 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=Qr4glRCFvCStMBfWx0nG7AfF2cv4z9BB43mLIwp9r3Q=; b=OvsFe80p5QkJJcHogMuXsjtVXNNZbtxfcrgMfOCdpMlLYziP+zfRXpYcH6aZ2iIBvT X6em/MhJedugXbD/fhljNymc/aLI1fNwysK7zlKanCqDJfPeAJ+1apeNfNCoLFZqg7sC N40jEWWQ0lCfupj/OfBvUErPOm+IpguNEAA2aJlQKRzcIA9LsKZBpi6qp+eLRc9ciXlf rGBL++qAzQYv9ZseuzM3DaCp69VJn0fWaYuEUqINRd9p7kphtNF2SQJM7T4178P3oewd 6GD0DVjfTfKMYU+75KWQVkrIDrVRRqFQ5aVc0hbzyETtW2i5M913nxdqNPPR1GbwjAFf D1Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UQbNoYNQ; 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 33-v6si16281930plg.62.2018.11.11.16.12.21; Sun, 11 Nov 2018 16:12:36 -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; dkim=pass header.i=@kernel.org header.s=default header.b=UQbNoYNQ; 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 S1730631AbeKLIRU (ORCPT + 99 others); Mon, 12 Nov 2018 03:17:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:60706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730600AbeKLIRU (ORCPT ); Mon, 12 Nov 2018 03:17:20 -0500 Received: from localhost (unknown [206.108.79.134]) (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 449F4223CE; Sun, 11 Nov 2018 22:27:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975244; bh=O007p9wAdW6a2EdWkF4orv5RUQiNYImQKy8HUvAGcAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UQbNoYNQvFKPEqlCC0p8Kmq9OwE9bOyqrpkkkhhRfFWgb3DAkiidqNmNz4UHvWJPf 3MDG11uvYQXETnFEI83TOp4pDgD/jBBteBunyiib/Ve4xyhIVn+WmJNeji0fXlO4P/ 4Lx9QozC+Jb3YdEC/S64GvrM0uirRJxWOh2cIPao= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Robinson , Hans de Goede , Ard Biesheuvel , Sasha Levin Subject: [PATCH 4.19 093/361] efi/x86: Call efi_parse_options() from efi_main() Date: Sun, 11 Nov 2018 14:17:20 -0800 Message-Id: <20181111221632.759756914@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans de Goede [ Upstream commit c33ce984435bb6142792802d75513a71e55d1969 ] Before this commit we were only calling efi_parse_options() from make_boot_params(), but make_boot_params() only gets called if the kernel gets booted directly as an EFI executable. So when booted through e.g. grub we ended up not parsing the commandline in the boot code. This makes the drivers/firmware/efi/libstub code ignore the "quiet" commandline argument resulting in the following message being printed: "EFI stub: UEFI Secure Boot is enabled." Despite the quiet request. This commits adds an extra call to efi_parse_options() to efi_main() to make sure that the options are always processed. This fixes quiet not working. This also fixes the libstub code ignoring nokaslr and efi=nochunk. Reported-by: Peter Robinson Signed-off-by: Hans de Goede Signed-off-by: Ard Biesheuvel Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/x86/boot/compressed/eboot.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c @@ -738,6 +738,7 @@ efi_main(struct efi_config *c, struct bo struct desc_struct *desc; void *handle; efi_system_table_t *_table; + unsigned long cmdline_paddr; efi_early = c; @@ -756,6 +757,15 @@ efi_main(struct efi_config *c, struct bo setup_boot_services32(efi_early); /* + * make_boot_params() may have been called before efi_main(), in which + * case this is the second time we parse the cmdline. This is ok, + * parsing the cmdline multiple times does not have side-effects. + */ + cmdline_paddr = ((u64)hdr->cmd_line_ptr | + ((u64)boot_params->ext_cmd_line_ptr << 32)); + efi_parse_options((char *)cmdline_paddr); + + /* * If the boot loader gave us a value for secure_boot then we use that, * otherwise we ask the BIOS. */