Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp237421ybi; Mon, 15 Jul 2019 20:01:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwh3ST48zl5pCyPnDLQXMnuFzGWP5R64Ao1foEE/LAUIPHUUdy+uZ6oEDTTUObq0mlmXnWF X-Received: by 2002:a63:231c:: with SMTP id j28mr3828741pgj.430.1563246099578; Mon, 15 Jul 2019 20:01:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563246099; cv=none; d=google.com; s=arc-20160816; b=nM4hB+DSmEHHmzEl8LCnVNNOc83wF4TkgyTZyluk9SxAi7yjX16eTidHTMNgopLDw3 c2ydi9EEg+XVOng1yVpezvI7nd2d4dpH9ss23IKHzMjw/7bYazXYfScMdhJ2crP7Lqsy UGy5L3SHbtKvHtSDRME2mW3fN/dx7dFYBfeYegS4BsJlDho3e7ajdWroxsGRlBy2Q55L fhAlgZeJB9J/JvMB6BOet2fJ95ubHmqZjekWDeMmFPAkKTQga1KJCDxPFfVAR/6GFARG tIeAA+CN8HbblQyLyodNgABOhqrOfOuj5ADyC+MhN297v4lsKG/PI4UTvxn2roLm/HQD JYFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=SYBbYNKLpuRUelj/QVWGzTVoGe/YMV8Em4ydROMmxI4=; b=lTUB+Rp6DNXr2fFr0Vw3EZG3evZXTO572fednMMUX7hRa5sm907fWi8PfnSYRL0kJl Q1ULmUwgP1DNPe9lBjglhf5laLGwH8U9rD1nRmL4JH52aD7IiVKhfjHuElzRr/jpY64j xRCTkvC9SJ5nF4kRgqW30CmEQhRti+eLdgFDEYJ83+GUw13JkNHV18vzTMdvoWajnBsl xM0fm0x/7YJ3qhqLEqaw32Jwe066XTdTS5Ix8QWUjLEIhktbLA6cY0oBxYHcmlNtjp/1 bbuhtUMP9hame1CUODEP1ovhlK7hEjC27MRaWuPQF7oiZHc9guNJ/QNbOfh78Ypo9Tz2 noYg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id br15si17106411pjb.43.2019.07.15.20.01.22; Mon, 15 Jul 2019 20:01:39 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730952AbfGPC7f (ORCPT + 99 others); Mon, 15 Jul 2019 22:59:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47084 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729145AbfGPC7f (ORCPT ); Mon, 15 Jul 2019 22:59:35 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 26AB5309178C; Tue, 16 Jul 2019 02:59:35 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-64.pek2.redhat.com [10.72.12.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B7F1D1001B04; Tue, 16 Jul 2019 02:59:27 +0000 (UTC) Date: Tue, 16 Jul 2019 10:59:23 +0800 From: Dave Young To: Matthew Garrett Cc: jmorris@namei.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Josh Boyer , David Howells , Matthew Garrett , Borislav Petkov , Kees Cook , linux-acpi@vger.kernel.org Subject: Re: [PATCH V35 15/29] acpi: Ignore acpi_rsdp kernel param when the kernel has been locked down Message-ID: <20190716025923.GA5793@dhcp-128-65.nay.redhat.com> References: <20190715195946.223443-1-matthewgarrett@google.com> <20190715195946.223443-16-matthewgarrett@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190715195946.223443-16-matthewgarrett@google.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 16 Jul 2019 02:59:35 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 07/15/19 at 12:59pm, Matthew Garrett wrote: > From: Josh Boyer > > This option allows userspace to pass the RSDP address to the kernel, which > makes it possible for a user to modify the workings of hardware . Reject > the option when the kernel is locked down. > > Signed-off-by: Josh Boyer > Signed-off-by: David Howells > Signed-off-by: Matthew Garrett > Reviewed-by: Kees Cook > cc: Dave Young > cc: linux-acpi@vger.kernel.org > --- > drivers/acpi/osl.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c > index 9c0edf2fc0dd..06e7cffc4386 100644 > --- a/drivers/acpi/osl.c > +++ b/drivers/acpi/osl.c > @@ -26,6 +26,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -180,7 +181,7 @@ acpi_physical_address __init acpi_os_get_root_pointer(void) > acpi_physical_address pa; > > #ifdef CONFIG_KEXEC > - if (acpi_rsdp) > + if (acpi_rsdp && !security_locked_down(LOCKDOWN_ACPI_TABLES)) > return acpi_rsdp; I'm very sorry I noticed this late, but have to say this will not work for X86 with latest kernel code. acpi_physical_address __init acpi_os_get_root_pointer(void) { acpi_physical_address pa; #ifdef CONFIG_KEXEC if (acpi_rsdp) return acpi_rsdp; #endif pa = acpi_arch_get_root_pointer(); if (pa) return pa; [snip] In above code, the later acpi_arch_get_root_pointer still get acpi_rsdp from cmdline param if provided. You can check the arch/x86/boot/compressed/acpi.c, and arch/x86/kernel/acpi/boot.c In X86 early code, cmdline provided acpi_rsdp pointer will be saved in boot_params.acpi_rsdp_addr; and the used in x86_default_get_root_pointer > #endif > pa = acpi_arch_get_root_pointer(); > -- > 2.22.0.510.g264f2c817a-goog > Thanks Dave