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=-6.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 95446C3A589 for ; Tue, 20 Aug 2019 22:08:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 659DB2332A for ; Tue, 20 Aug 2019 22:08:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730910AbfHTWIw (ORCPT ); Tue, 20 Aug 2019 18:08:52 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:50629 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730092AbfHTWIv (ORCPT ); Tue, 20 Aug 2019 18:08:51 -0400 Received: from 79.184.254.79.ipv4.supernova.orange.pl (79.184.254.79) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.275) id 58fce0e735fe6fb1; Wed, 21 Aug 2019 00:08:49 +0200 From: "Rafael J. Wysocki" To: Matthew Garrett Cc: jmorris@namei.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Linn Crosetto , David Howells , Matthew Garrett , Kees Cook , linux-acpi@vger.kernel.org Subject: Re: [PATCH V40 16/29] acpi: Disable ACPI table override if the kernel is locked down Date: Wed, 21 Aug 2019 00:08:48 +0200 Message-ID: <18886542.jEbjgeBmpC@kreacher> In-Reply-To: <20190820001805.241928-17-matthewgarrett@google.com> References: <20190820001805.241928-1-matthewgarrett@google.com> <20190820001805.241928-17-matthewgarrett@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Tuesday, August 20, 2019 2:17:52 AM CEST Matthew Garrett wrote: > From: Linn Crosetto > > >From the kernel documentation (initrd_table_override.txt): > > If the ACPI_INITRD_TABLE_OVERRIDE compile option is true, it is possible > to override nearly any ACPI table provided by the BIOS with an > instrumented, modified one. > > When lockdown is enabled, the kernel should disallow any unauthenticated > changes to kernel space. ACPI tables contain code invoked by the kernel, > so do not allow ACPI tables to be overridden if the kernel is locked down. > > Signed-off-by: Linn Crosetto > Signed-off-by: David Howells > Signed-off-by: Matthew Garrett > Reviewed-by: Kees Cook > cc: linux-acpi@vger.kernel.org > Signed-off-by: James Morris Acked-by: Rafael J. Wysocki > --- > drivers/acpi/tables.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c > index de974322a197..b7c29a11c0c1 100644 > --- a/drivers/acpi/tables.c > +++ b/drivers/acpi/tables.c > @@ -20,6 +20,7 @@ > #include > #include > #include > +#include > #include "internal.h" > > #ifdef CONFIG_ACPI_CUSTOM_DSDT > @@ -577,6 +578,11 @@ void __init acpi_table_upgrade(void) > if (table_nr == 0) > return; > > + if (security_locked_down(LOCKDOWN_ACPI_TABLES)) { > + pr_notice("kernel is locked down, ignoring table override\n"); > + return; > + } > + > acpi_tables_addr = > memblock_find_in_range(0, ACPI_TABLE_UPGRADE_MAX_PHYS, > all_tables_size, PAGE_SIZE); >