Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp846964ybd; Sat, 22 Jun 2019 17:02:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKD3SozZ5JnD+hBYgRLIXSVeET/TipO+tg4HQW/beP6dUONorYE/ztiAT9xM2/q88Ah72n X-Received: by 2002:a17:902:9a42:: with SMTP id x2mr124197588plv.106.1561248122094; Sat, 22 Jun 2019 17:02:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561248122; cv=none; d=google.com; s=arc-20160816; b=OlbmrL2GqrsB9mmszAAal0sS+Pe8TkHQbZJjGLycsX8HlsAWTdlPYihCkMEJLTE/Ft QL/nlX7CZrJRJEMjTXx7cioTVjAGyiuaJx92AoAuPOQrdYyx/g36WVCag1N30TSDbUqR N0s9q9pX+p+8jlbi5rv/agWm09c4bO74GhHisLLRXwLOeVkJKSwvlmz4+WelrigooTl3 O2JrPzaWcWbqx3cvKu3roMjJ6FBTqczU+rlusCGUoja7dhZfZI8WhuGj+1iVz2HtUTQq dbLNpgtpfLHSAXm/0ck/YZopEjxOXBncusYfwuex1IJUSARRxzxg2bJ95UZfJfHZFwhA 75xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=l17kSA4cebdwaszrX4PylxVfM6zz9iSc9kiB9UHWgW8=; b=lK5H4XiK2rkW2LoFIEewTh+/9MFMBCdRV02/IgVtODC/5JmjGU/R6q9Do3sPkjl3cB S/jjHz3ZSWuREn3clsVcStHLMwIdTefhLvT2GYGy6oMvcW1DQ1HQp1dwZMfIXBaAsQaf Gjxx3fbrbBx/lIR5SMtcHPf6xIoXXXA5L6obwFooJT5UkUMXEd1p9HeKFnWB8PIeAPm7 JK1P+JQSZtSmvOGRaOi8LOuLJZ63NH1o6qnaHjnXS6avYV3FlBXAPcAjW8wlSEPuI52H y/OJ9gqFtmBMPb2BEZJyYt9zBrFwH5JV76wm3WePyLUf14P2ay1uWSY/gi4nHOoEC00L uoaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aOU8uC4Y; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9si6133704pgc.321.2019.06.22.17.01.46; Sat, 22 Jun 2019 17:02:02 -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=@chromium.org header.s=google header.b=aOU8uC4Y; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726529AbfFWAAQ (ORCPT + 99 others); Sat, 22 Jun 2019 20:00:16 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:45812 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726455AbfFWAAQ (ORCPT ); Sat, 22 Jun 2019 20:00:16 -0400 Received: by mail-pf1-f194.google.com with SMTP id r1so5416237pfq.12 for ; Sat, 22 Jun 2019 17:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=l17kSA4cebdwaszrX4PylxVfM6zz9iSc9kiB9UHWgW8=; b=aOU8uC4Ys2KdB/JtPKpjtGhmwAOIsOGljrGxasiCVO7n0QTwpHnA3sRlTfHGTRKIe9 tfUOHXZYpwfvhQErKfAwgaT6eeP+6My+2ksDjqwGFUPbQVtrDNSyycqeax2C8uI2IRqt 1+NaYESergzZE+e+wIDckd0BpScJsDfEq2jF0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=l17kSA4cebdwaszrX4PylxVfM6zz9iSc9kiB9UHWgW8=; b=sLBxhZkHWA7hcsNelRpUO0FCR/AZPohiVPCRrlfCY/SFoKiwC9OcOVYUAVTh5ZeqHW oKIoyfMPCixyEVCUsQNbDB048pQoRMlAWWal+MIgwn0W2VmDMc13rprUtz37EnOENKt1 1g2HkQBpOQmgFul7vlBKtTSXp1ruuvIKvEJObb8nqNzSjP2g4R9C12ySmP9+BXfdzjDq /7CKeqBEY7/3VeZu8CKkuLwcygPPnbW24KwmhbUcCFax6aVcOWKAHw4luwkEhHrt4VhW hxvoySQ/alJQNgWKwXUqyT6it1SlEI2tYacIArf/46vvDLVII+MmILziOWU8g8YGqLJr nlkw== X-Gm-Message-State: APjAAAXQMlm+vxVZi5d8yFPiL0868J5RrB0I9P6sxRjAzJhUPb1Z1KFM ZghrP8o91NMJ/gxoAsfEd+n8wA== X-Received: by 2002:a63:5a02:: with SMTP id o2mr24596077pgb.93.1561248015012; Sat, 22 Jun 2019 17:00:15 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id e20sm6740048pfi.35.2019.06.22.17.00.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Jun 2019 17:00:13 -0700 (PDT) Date: Sat, 22 Jun 2019 17:00:12 -0700 From: Kees Cook 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 , linux-acpi@vger.kernel.org Subject: Re: [PATCH V34 16/29] acpi: Disable ACPI table override if the kernel is locked down Message-ID: <201906221700.B1CA4EF77E@keescook> References: <20190622000358.19895-1-matthewgarrett@google.com> <20190622000358.19895-17-matthewgarrett@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190622000358.19895-17-matthewgarrett@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 21, 2019 at 05:03:45PM -0700, 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 Reviewed-by: Kees Cook -Kees > Signed-off-by: David Howells > Signed-off-by: Matthew Garrett > cc: linux-acpi@vger.kernel.org > --- > drivers/acpi/tables.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c > index 8fccbe49612a..41d9ccd0e075 100644 > --- a/drivers/acpi/tables.c > +++ b/drivers/acpi/tables.c > @@ -34,6 +34,7 @@ > #include > #include > #include > +#include > #include "internal.h" > > #ifdef CONFIG_ACPI_CUSTOM_DSDT > @@ -539,6 +540,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); > -- > 2.22.0.410.gd8fdbe21b5-goog > -- Kees Cook