Received: by 10.192.165.156 with SMTP id m28csp1058753imm; Wed, 11 Apr 2018 11:39:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx49lhSKSqsWYtIZ/Fm/uXpf/rF03oIrxY1wecVdNLSjEAhCfSLc+ExIcA6YW/PjI8c4gIuQr X-Received: by 2002:a17:902:7201:: with SMTP id ba1-v6mr6187008plb.283.1523471949954; Wed, 11 Apr 2018 11:39:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523471949; cv=none; d=google.com; s=arc-20160816; b=yu/IrnTivpLIvhQyQj2fFy1GcszPA064lUCyh1qqguprlcvNrGm5sZ5LCkO687EEIK gTUnJ+RYK5mv5C2dGujelZxpbD5MqtvtErPJ2Clfamc7K3Y3uU+XrpP6u4cSuYZYw/WM DmIWEDR+3f3pCoLlnE+kcQ7pACM7+EmNx+yG/2EPJ58Bknik/wo6d7BDDK8FqR4d9iCR FHDAnQ5YNQ4c++Cyzg0amX3LZzhRUnIbmadlB0TeQnKi97h6qnnCUw+yUcTXWY8UjxyZ m4ndqXgLObB2/yb3CdggX53SPY5aNjYdaA4vo6uFGA7yJG3rfiUr54rZq1F0oY+Vik7c CNPw== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=aONYQf86/qEf44GjzeeOaTi2M38fpWBk0zuUDU5F2OU=; b=01bIdU9O+m7ohIbpcfZ3dRCzLTqT83AP0iusUVIbbA3q3pDOeTF/sO2gc0IbEfCjdq VjTtu0I/k1luGofWvsiNYAj6+6ONE02WznmZBPmyZhJ/HDJOTYiphcouBiT/S/g3syPg 1xd9j3P3amL8dcXBLcafEKHsNtsOTnQBds4UXvcmEASlRrgHAUbhxUz6KSwNtqz+pv4+ Wk0+g1VayAmg3H5jZL15OGNi/tuqi4KxnnSMvN/5z23rfja3HvD57v1U2zbdJzWx13Wo KoSoQm1cs86I2rVhWroM8B1KFMpyT7cZX05wGdjeX019PCnIx/xng7qDZIsIGdvWqlDY opwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxtx.org header.s=google header.b=PAJqGwhh; 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 z2-v6si1645071plk.94.2018.04.11.11.38.33; Wed, 11 Apr 2018 11:39:09 -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=@linuxtx.org header.s=google header.b=PAJqGwhh; 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 S1753364AbeDKSfd (ORCPT + 99 others); Wed, 11 Apr 2018 14:35:33 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:44027 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753193AbeDKSfa (ORCPT ); Wed, 11 Apr 2018 14:35:30 -0400 Received: by mail-io0-f193.google.com with SMTP id q84so3453939iod.10 for ; Wed, 11 Apr 2018 11:35:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxtx.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=aONYQf86/qEf44GjzeeOaTi2M38fpWBk0zuUDU5F2OU=; b=PAJqGwhh/pQNx5f+EdWWKPLCWbhFw4pQ1rqMUpNj174sIfuLQ4ETF2FxJ43NLv3Bk8 oXbPlyadL7XGjOQM+vsJv2HriOaimYHSf0xpOiYibwgj+CtJEG4JM//r4ujBtZxlOZww PecWvN9MB38+WcTLgZHeNvEhshlSrR7OjvDqo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=aONYQf86/qEf44GjzeeOaTi2M38fpWBk0zuUDU5F2OU=; b=EX/Uqyy3eATs3S/axz2iJkwvsdPRjQbt0yX2tF6REZCIUFRKq10Qjkj3vnT8zKa3oe S5zvQJQwpn2a3g40nFpSr9KTDlwRdhEP7FKnHfqABV4BfjR8g6P4m6YCKeiO/StAA/S8 2/xzQ9HqlCECm33CNTMj2Cc6zqaRrVOTYD0YioSbUs1hFYkUETeuT7YNONs0LFAj0+If Z3Xyd5uh7F0ns2KIASJsZCkJxZxbt096b+xskqOSrUSoGzDlaywkyxhfblgeIcdqlzcc 0TPYkZS1Mob57SSW8XHv1FxkSj3nKLd8sMcll34uTLHmU9tAu9RqApVVeU6m8dd5XNQ1 96hQ== X-Gm-Message-State: ALQs6tBPs/NKy6C2sC/6E0J8PEN3sA7afBEje4bjyH1ip3VMHibRgkqW 55BuviEXC+6JnS3PlbBDWYngbqk4hbq22ZgPHXhMVA== X-Received: by 10.107.200.203 with SMTP id y194mr5628667iof.182.1523471729824; Wed, 11 Apr 2018 11:35:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.163.75 with HTTP; Wed, 11 Apr 2018 11:35:29 -0700 (PDT) In-Reply-To: References: <152346387861.4030.4408662483445703127.stgit@warthog.procyon.org.uk> <152346388583.4030.15146667041427303547.stgit@warthog.procyon.org.uk> From: Justin Forbes Date: Wed, 11 Apr 2018 13:35:29 -0500 Message-ID: Subject: Re: [PATCH 01/24] Add the ability to lock down access to the running kernel image To: Linus Torvalds Cc: David Howells , linux-man , Linux API , James Morris , Linux Kernel Mailing List , LSM List 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, Apr 11, 2018 at 1:09 PM, Linus Torvalds wrote: > On Wed, Apr 11, 2018 at 9:24 AM, David Howells wrote: >> Provide a single call to allow kernel code to determine whether the system >> should be locked down, thereby disallowing various accesses that might >> allow the running kernel image to be changed, including: >> >> - /dev/mem and similar >> - Loading of unauthorised modules >> - Fiddling with MSR registers >> - Suspend to disk managed by the kernel >> - Use of device DMA > > So what I stlll absolutely detest about this series is that I think > many of these things should simply be done as separate config options. > > For example, if the distro is sure that it doesn't need /dev/mem, then > why the hell is this tied to "lockdown" that then may have to be > disabled because *other* changes may not be acceptable (eg people may > need that device DMA, or whatever). > > If that /dev/mem access prevention was just instead done as an even > stricter mode of the existing CONFIG_STRICT_DEVMEM, it could just be > enabled unconditionally. > > So none of these patches raise my hackles per se. But what continues > to makes me very very uncomfortable is how this is all tied together. > > Why is this one magical mode that then - because it has such a big > impact - has to be enabled/disabled as a single magical mode and with > very odd rules? > > I think a lot of people would be happier if this wasn't so incestuous > and mixing together independent things under one name, and one flag. > > I think a lot of the secure boot problems were exacerbated by that mixup. > > So I would seriously ask that the distros that have been using these > patches look at which parts of lockdown they could make unconditional > (because it doesn't break machines), and which ones need that escape > clause. > Optionally, it might make sense to add separate config options for each of these pieces which can be unconditionally enabled, and a separate option for secure boot which selects all of them? As much as I hate select, it might make sense here. Of course the flip side to that, is users no longer have one big switch "turn off secure boot" which turns it all off in case of trouble. Justin