From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6ABB2C76191 for ; Tue, 16 Jul 2019 02:59:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 436612080A for ; Tue, 16 Jul 2019 02:59:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729635AbfGPC7f (ORCPT ); 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-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@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