Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp36736ybl; Tue, 20 Aug 2019 15:10:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyC3l8pHOhchC09zD/Ns5fLFkZmB1eNzXpEpdQc+v+n4n0sWS9vSKErUItt2v9Nmx+7ft4C X-Received: by 2002:a17:90a:c68c:: with SMTP id n12mr2170750pjt.33.1566339014614; Tue, 20 Aug 2019 15:10:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566339014; cv=none; d=google.com; s=arc-20160816; b=S2hXpKhJPRQ/cYF/jJVvjA8E8O+9iyohhHNlQi1B3Dje6dW1kESA8RR8y+4I0UXBs1 Q+bMBCljj6bdUWfYWvlEymNt3Ds5eAcrRDdSgQm1b5rs8OqpNKVqA1mfqG+18TzVLhvt brAvVCJW7X4xxoXiijZBj5w9xXlkpOpjrcVlnzpUmJQKDH+UHgijSi4eJfxWo4kEE35W ahDer6m7VRFWqB40Ee6dXv3vHn0N76hVvCgYEd/2pbFzTjKTIYDFXosnkUhhS0PaRtvs 3/K+fEGdnrkI3JMHbY+2l75lRxCcrxdMlxdz79YvzfbFM9V9gUF94YRDNw4mO44lleCW pkYQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=op6kWtWdNEVB3HJUGilcQuD1NRzaVigbYeQukd0WDmg=; b=CEHUTjtYNuUeXpcI+U6gc4C4rnqBGeu9OMNzFpmESTOODdXaU+D3XLEpMfJJOGQmBg +sQO/Tev5EkA+Fe16iABUoWRfU0yRBQl4JeaR6tGJrFrTDo9TXPOihhaEeIxAnPYnyKP 4wnsU4xNBOTtTn+xDTIwKD+pRjAgKWt4sJA2qyyrTueWROppKBCHX8qFjAHWa1wzJxEA w97/pwGufKVWe01kBVlb/wxVEe/vnoVljHVKAoRJkZvbRv+g8pvFlASdFGFDm/E0OY7o TIOolvX0VzgWuwbeXnp61WXvd42WxSWd8yfsR19G+NxsBxeSdj53fs5LxZtWC6e8POUv s6NQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r23si12768720pgv.451.2019.08.20.15.09.59; Tue, 20 Aug 2019 15:10: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; 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 S1731007AbfHTWIw (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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); >