Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp321965ybt; Wed, 17 Jun 2020 01:40:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVZeELypGYpOyeCUuVvz0rYh5Vt7M9lj2+GHfmV/WaBX0sSE9P9qzU0BwMoRWALnPmRTxC X-Received: by 2002:aa7:c2c4:: with SMTP id m4mr6068263edp.299.1592383205363; Wed, 17 Jun 2020 01:40:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592383205; cv=none; d=google.com; s=arc-20160816; b=x3IXxiciHAAn0VGStQU+eBhS+QyrkBMzz8/c/rZJf2P7BM/bc9Mw9Uw0AeMp3+iabL YFAtCKSgspQsPAhrDSPB751N8X/HoGzeyDXIzkwRIvzbc1VM+Y099xFRDdfH4ayXnoJB VVlf4PQoHwz1EtTFxwoQrA04mFSyWpif3/iVSL7KgGTcalQxKy9P/JwDNCkX+kDXrPpd K4VSbz336x884U19d992Qisfv8WBTaEDJdrdEpQmD9SdOnQRXMhBnWkjaSTEA3kqHZ5P d5FOrwvqgrp2NU9G0/X0a9ky3cMvpgx1+1mZ3yQyMDlKGAjcmjGdoz/eh/Pur2YSxaMM 6qzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=eWxs3nB/7UcJdvfwSzWTNvyv1bWD2Dy3QiER8xtR+Qo=; b=LZmXCkKTRC+r/pX8MOguK3J28YbWZ475DbJsRrXK+fUCm+qjoMj4QSXdV5lkAcZLOm Z1P28m9Pngv6GcR5rav5EMtOwVqZ9v+U3tzqpCOWJ2Q9szukpEPU5lGKvLOXuyyW0Xxx 353WNDPNOY2D5U6mbm3rVpTYmR38TN989eEXjvffFJaL6ffN68wcCLkkkJEaSpMkV6hF ypNOPUAJ6D6N5gSYlH2LPSHbfOsg/gopsLFsgojTzRG8zmLVnAaN59IeK/e8ny1HGkrc 4hhQCblmOGx9aytviSj70UN2tmo7hA04r5jwS/i7t9Zi1c0CHsLUYcQ6AZIWZI0ne9aU myCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="E5Pk/q21"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e1si13611821edl.449.2020.06.17.01.39.43; Wed, 17 Jun 2020 01:40:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="E5Pk/q21"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726964AbgFQIiF (ORCPT + 99 others); Wed, 17 Jun 2020 04:38:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:51294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725964AbgFQIiE (ORCPT ); Wed, 17 Jun 2020 04:38:04 -0400 Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 06C0B212CC; Wed, 17 Jun 2020 08:38:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592383084; bh=eWxs3nB/7UcJdvfwSzWTNvyv1bWD2Dy3QiER8xtR+Qo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=E5Pk/q21L4XYpxwsPRqpQvJFKWBqQfH+fQbSfBBfdgjkN2G2l+qH5bfVBVKN5b3zV RFdwLJkO66yeNRhrwzK/X/NwGgJyf3k8yhT4nSlZ3UZxgXSzrNJp4JfGoIRc/dfHaw S+/yBwBXAg3GryE113CQ8pbAaumSZ7nQ0HV4/VCM= Received: by mail-ot1-f54.google.com with SMTP id m2so962168otr.12; Wed, 17 Jun 2020 01:38:03 -0700 (PDT) X-Gm-Message-State: AOAM533k56lQ6d9JJ9xFX0FtFrZFn+G22QNlDOv8HZSYz2YeO3Tm3+i6 J/Xb5NRJ0IfTTyP03jIz9L3A9GAUG0+ylbuPgzs= X-Received: by 2002:a9d:476:: with SMTP id 109mr6237581otc.77.1592383083393; Wed, 17 Jun 2020 01:38:03 -0700 (PDT) MIME-Version: 1.0 References: <20200615104332.901519-1-Jason@zx2c4.com> In-Reply-To: From: Ard Biesheuvel Date: Wed, 17 Jun 2020 10:37:52 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] acpi: disallow loading configfs acpi tables when locked down To: "Jason A. Donenfeld" Cc: Len Brown , "Rafael J. Wysocki" , LKML , ACPI Devel Maling List , Kernel Hardening Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 17 Jun 2020 at 00:21, Jason A. Donenfeld wrote: > > Hi Rafael, Len, > > Looks like I should have CC'd you on this patch. This is probably > something we should get into 5.8-rc2, so that it can then get put into > stable kernels, as some people think this is security sensitive. > Bigger picture is this: > > https://data.zx2c4.com/american-unsigned-language-2.gif > https://data.zx2c4.com/american-unsigned-language-2-fedora-5.8.png > > Also, somebody mentioned to me that Microsoft's ACPI implementation > disallows writes to system memory as a security mitigation. I haven't > looked at what that actually entails, but I wonder if entirely > disabling support for ACPI_ADR_SPACE_SYSTEM_MEMORY would be sensible. > I haven't looked at too many DSDTs. Would that break real hardware, or > does nobody do that? Alternatively, the range of acceptable addresses > for SystemMemory could exclude kernel memory. Would that break > anything? Have you heard about Microsoft's mitigation to know more > details on what they figured out they could safely restrict without > breaking hardware? Either way, food for thought I suppose. > ACPI_ADR_SPACE_SYSTEM_MEMORY may be used for everything that is memory mapped, i.e., PCIe ECAM space, GPIO control registers etc. I agree that using ACPI_ADR_SPACE_SYSTEM_MEMORY for any memory that is under the kernel's control is a bad idea, and this should be easy to filter out: the SystemMemory address space handler needs the ACPI support routines to map the physical addresses used by AML into virtual kernel addresses, so all these accesses go through acpi_os_ioremap(). So as a first step, it should be reasonable to put a lockdown check there, and fail any access to OS owned memory if lockdown is enabled, and print a warning if it is not.