Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4037154ybe; Mon, 9 Sep 2019 03:12:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwF9vCM6X4SnpUF08JiDrhKV3hVuepkVCqC0hQmYKMTZZwmSDnZT43CPEOKZ6JKlbAGdcA2 X-Received: by 2002:a50:c90c:: with SMTP id o12mr7451686edh.126.1568023934314; Mon, 09 Sep 2019 03:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568023934; cv=none; d=google.com; s=arc-20160816; b=ZNjdYuogoSDUz+2xhTkfwEp6JT35Zzh7i5PZuCLlchqy+yg2/TBBf372U2vbYpGsO1 o6jbKSs+AUPPShzhx3tooEbDp5PAvn+nDMYoPjTiyYxBVy5p+xMuIGRK2N89gAwfsO/i d8HSPJvNOQ2Dfuexv1PE3vP7cWQ3slE0mIR8/M6bQY2Uzua+DYfk9fiLBrnR4Wmyq4LA IfRmVeQpGIfjP3j2HxIRsk6D77qO8N+syBAZsvHoJFvhOvthhObtrSB+fmcSfvFtUK7k SFlbzLK6mpPhUA+ret8w6XdYEgMULIQG8YPJrAVH9ngNlu05DJgsnRV2hDpcUSpeBbho BXzQ== 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=ClgdYr2I37D5F40S/7VB+Puwg66Zl6bxhN3TxE7ZlgU=; b=Hd1i7G9qNELY+tM+rXRSfZFzzZ2XXRUzjNWA6kgNkD2BguQ14NPA1rZSmYPkhBMw8K S1Ku+v//8/ynJ+rK12i6Dgrkt2hShdj67dBa230/F8KVplzANlQ/ng1iD1l1N5QxsRZL m7HNqmHXvm+cYWKW4IAM7CEnMZAoYy+Wt8jrenRiHqPAd+FjftuIsL485C4MMiZlVTNB 5KAnlKi06g53fOSAdRaG/Y5sbSCWvEBqMzTbv2LKhkDxfU3zAKJvwVtxzD6pyprewDYB szpZkRAF7jjQyfDa2Z4/w1eD96KdQE/dQ/npLbRT4ez1SIDem/xyB6NWltPRIYA+ft0f fKHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=n3oOGTwg; 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 j47si8439377ede.117.2019.09.09.03.11.50; Mon, 09 Sep 2019 03:12:14 -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=n3oOGTwg; 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 S1730425AbfIHMqg (ORCPT + 99 others); Sun, 8 Sep 2019 08:46:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:34166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730389AbfIHMqa (ORCPT ); Sun, 8 Sep 2019 08:46:30 -0400 Received: from localhost (unknown [62.28.240.114]) (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 CF6EE218AE; Sun, 8 Sep 2019 12:46:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946789; bh=LtTjOxgtRGF6LCCtjHjnp/619AMlBzyRmzOQMaARqIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n3oOGTwg/w3qVY4gu05fuUaV829mV5/zaqOzLxEhePJ5ZD6AopAC0ZGrb6AveIimu YJQyigA+dgwbKrenneyNMH/uP9MjyvIZoE0zw/QdzxZfH15+lhYnG5b7uarsclM/mw B2143Ny67JWdJ3exvlWYxA8+kpabDUNrADdzYSio= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "John S. Gruber" , Borislav Petkov , John Hubbard , "H. Peter Anvin" , Ingo Molnar , Juergen Gross , Mark Brown , Thomas Gleixner , x86-ml Subject: [PATCH 4.14 40/40] x86/boot: Preserve boot_params.secure_boot from sanitizing Date: Sun, 8 Sep 2019 13:42:13 +0100 Message-Id: <20190908121132.874903916@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121114.260662089@linuxfoundation.org> References: <20190908121114.260662089@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: John S. Gruber commit 29d9a0b50736768f042752070e5cdf4e4d4c00df upstream. Commit a90118c445cc ("x86/boot: Save fields explicitly, zero out everything else") now zeroes the secure boot setting information (enabled/disabled/...) passed by the boot loader or by the kernel's EFI handover mechanism. The problem manifests itself with signed kernels using the EFI handoff protocol with grub and the kernel loses the information whether secure boot is enabled in the firmware, i.e., the log message "Secure boot enabled" becomes "Secure boot could not be determined". efi_main() arch/x86/boot/compressed/eboot.c sets this field early but it is subsequently zeroed by the above referenced commit. Include boot_params.secure_boot in the preserve field list. [ bp: restructure commit message and massage. ] Fixes: a90118c445cc ("x86/boot: Save fields explicitly, zero out everything else") Signed-off-by: John S. Gruber Signed-off-by: Borislav Petkov Reviewed-by: John Hubbard Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Juergen Gross Cc: Mark Brown Cc: stable Cc: Thomas Gleixner Cc: x86-ml Link: https://lkml.kernel.org/r/CAPotdmSPExAuQcy9iAHqX3js_fc4mMLQOTr5RBGvizyCOPcTQQ@mail.gmail.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/bootparam_utils.h | 1 + 1 file changed, 1 insertion(+) --- a/arch/x86/include/asm/bootparam_utils.h +++ b/arch/x86/include/asm/bootparam_utils.h @@ -71,6 +71,7 @@ static void sanitize_boot_params(struct BOOT_PARAM_PRESERVE(eddbuf_entries), BOOT_PARAM_PRESERVE(edd_mbr_sig_buf_entries), BOOT_PARAM_PRESERVE(edd_mbr_sig_buffer), + BOOT_PARAM_PRESERVE(secure_boot), BOOT_PARAM_PRESERVE(hdr), BOOT_PARAM_PRESERVE(e820_table), BOOT_PARAM_PRESERVE(eddbuf),