Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp128947imm; Thu, 20 Sep 2018 20:02:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYq87ePNXg6+hGVmCjr+LqKjVktNc7koZipnE2eqNCTwL0mROJxaBRXeoIh6A43y2mjHywu X-Received: by 2002:a17:902:9a8a:: with SMTP id w10-v6mr41199267plp.14.1537498951190; Thu, 20 Sep 2018 20:02:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537498951; cv=none; d=google.com; s=arc-20160816; b=zj2dCPOpcRnzHyRyN/I2G01zYx9KM92dZMlD1s4+T2z7p9i3AQ7iO9z91tYoFVn7pl kFB8hFv1kEfdb8PSFMSPGiOHPdbRhovnHAXXEOWuiYmWfq8Pdtp7Fc027EbpE2hgOTv3 bWuboYL0guccGdmbuFH0acPgFInZpQ8IT7YuVzrWEfE29EubWy89w2OgVsA42pfH6/Ue QdqBiC868L/nhyFfYLoXNUTLbVPIdy88W2Rf0AWIcWTwHFn1DIRYlLJA7CyBqs4syKY5 d0y/zpqsXRGX4I3+5jPVnXNVpBwyY+cRI71OF/7zmSeR1M2M4I9f3ULvzyq6eY6KwC20 d4mw== 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; bh=pyD3m6E5xpzzgx6cR5aSzJI3I2qIkiqcmrw12FtYyUA=; b=IAJSvOgcXWP2PNWQcqlGr10Edk1DjZy9FtyKdHgsPgXr+wti2O26ywxAe8yhMPxVgL w2ycA3rt9Lwh82rwZjVa55iVQRY8nBGhWLiOC2PgvEFMQvxSmY3UJKvTslPgEkhLlT6v eyGZBo6WRU6Nx0M4EjT31cu/3lnNvujBVGgtfVWE5Dk+vMiWnj5yVWJexdwvNFpKUbrp +1+0ykNGKWyF/Xu1hx0q5C78Q6Wo/bhWJNPOJn93xG5p6LNg8RgTW0YiR5lM1JRQTDRz mNU2PYW1Kzjd0CKtAWl9jNmo4B6rwjd5QAOiIW5wKtAW3kTvn4ENsrrrpqVnJDtxsSi3 o8Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TYuXHdbJ; 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 n7-v6si25847127plp.71.2018.09.20.20.02.15; Thu, 20 Sep 2018 20:02:31 -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=TYuXHdbJ; 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 S2389035AbeIUIss (ORCPT + 99 others); Fri, 21 Sep 2018 04:48:48 -0400 Received: from mail-yw1-f67.google.com ([209.85.161.67]:40315 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727141AbeIUIsr (ORCPT ); Fri, 21 Sep 2018 04:48:47 -0400 Received: by mail-yw1-f67.google.com with SMTP id z143-v6so4644162ywa.7 for ; Thu, 20 Sep 2018 20:02:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pyD3m6E5xpzzgx6cR5aSzJI3I2qIkiqcmrw12FtYyUA=; b=TYuXHdbJe0RBgK90gj1Yb0ScC3ZbfBO/AJ1UCb8S0xGExW4mvDkveDyN50fIA/JagA PtitRVPTGnlvjOkDGIvzbqtx/hfrqQqTKofjA3bopDKHRcTS55ibEuwJQGTkI7Jf4KkG 16jjGvhYs0qQAMRtvM8rspSVZzeuwlqPqUXYQ= 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=pyD3m6E5xpzzgx6cR5aSzJI3I2qIkiqcmrw12FtYyUA=; b=A7NE7Qf4i/6W5f4tErqHXjl9CnKej2//uG1tsUu/QRzOMdNZEvxGvZGtNZzJA1LZ1+ Mok9YLtRbFsa3G81j9SjNtRkPbvV+QR6STK+ijIW92BmjLonC7oGDmBuHfDFQ8NTsOCG nZFK2VTS2DS3RbGq1RDLEzD0g7ArODcJAHZjSznSfWkegwY9VpoTd6br/kx5v4908cVS bNVaVaphAadVLhX97bzz4AbFChxrXKbDQSKA+9mnIde/3cYL5EXpeF9+3zNkyvaYIjbb uTJFIDl27IvNiBRAfYXuKq23PB8z5TCJTslSHKxBBnWRQ6uzdj0dUbwRwXUPFRGSWOnp 1NWA== X-Gm-Message-State: APzg51Dw2WD2RTjNZjTVqETFsw8Wuo8y5cbb1SqHEilKuT1cwS/VS9YY dQxG3BmAx51k0oTpArZQKH7rR/XFUQM= X-Received: by 2002:a81:4689:: with SMTP id t131-v6mr19653147ywa.496.1537498924026; Thu, 20 Sep 2018 20:02:04 -0700 (PDT) Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com. [209.85.219.182]) by smtp.gmail.com with ESMTPSA id j8-v6sm6071166ywj.6.2018.09.20.20.02.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 20:02:02 -0700 (PDT) Received: by mail-yb1-f182.google.com with SMTP id c4-v6so4854834ybl.6 for ; Thu, 20 Sep 2018 20:02:02 -0700 (PDT) X-Received: by 2002:a25:238d:: with SMTP id j135-v6mr2067179ybj.137.1537498921935; Thu, 20 Sep 2018 20:02:01 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:5f04:0:0:0:0:0 with HTTP; Thu, 20 Sep 2018 20:02:01 -0700 (PDT) In-Reply-To: <74ecd4ec-491b-93d7-4e3f-46f92121130b@canonical.com> References: <20180920162338.21060-1-keescook@chromium.org> <20180920162338.21060-27-keescook@chromium.org> <7d2cc28b-aee5-ee91-9362-f92f8ca30adc@schaufler-ca.com> <6c899d9e-45aa-8159-c402-b3c4d1936112@canonical.com> <74ecd4ec-491b-93d7-4e3f-46f92121130b@canonical.com> From: Kees Cook Date: Thu, 20 Sep 2018 20:02:01 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH security-next v2 26/26] LSM: Add all exclusive LSMs to ordered initialization To: John Johansen Cc: Casey Schaufler , James Morris , Tetsuo Handa , Paul Moore , Stephen Smalley , "Schaufler, Casey" , LSM , Jonathan Corbet , "open list:DOCUMENTATION" , linux-arch , LKML 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 Thu, Sep 20, 2018 at 7:14 PM, John Johansen wrote: > On 09/20/2018 07:05 PM, Kees Cook wrote: >> On Thu, Sep 20, 2018 at 6:39 PM, John Johansen >> wrote: >>> On 09/20/2018 06:10 PM, Casey Schaufler wrote: >>>> On 9/20/2018 5:45 PM, Kees Cook wrote: >>>>> On Thu, Sep 20, 2018 at 5:25 PM, Casey Schaufler wrote: >>>>>> On 9/20/2018 9:23 AM, Kees Cook wrote: >>>>>>> config LSM_ORDER >>>>>>> string "Default initialization order of builtin LSMs" >>>>>>> - default "yama,loadpin,integrity" >>>>>>> + default "yama,loadpin,integrity,selinux,smack,tomoyo,apparmor" >>>>>> If I want to compile all the major modules into my kernel and use >>>>>> AppArmor by default would I use >>>>>> >>>>>> default "yama,loadpin,integrity,apparmor,selinux,smack,tomoyo" >>>>>> >>>>>> or >>>>>> >>>>>> default "yama,loadpin,integrity,apparmor" >>>>> I was expecting the former, but the latter will have the same result. >>> >>> t find having the two be equivalent violates expectations. At least >>> when considering the end goal of full/extreme stacking, its trivially >>> the same with current major lsms being exclusive >> >> This mixes "enablement" with "ordering", though, and I think the past >> threads have shown this to be largely problematic. >> >> However, with CONFIG_LSM_ENABLED, we get the effect you're looking for, IIUC. > > no, I was just stating in a world where we have full stacking those two > are not equivalent, as I would assume the order of any lsm not listed > may end up being different. Right, the ordering would be defined first by runtime (lsm.order=) followed any missing LSMs then ordered by their order in CONFIG_LSM_ORDER=, followed by any still missing LSMs then ordered by their order at link-time (which *may* be Makefile order, but could change with LTO, etc). >>>>>> When we have "blob-sharing" how could I compile in tomoyo, >>>>>> but exclude it without a boot line option? >>>>> Ooh, yes, this series has no way to do that. Perhaps >>>>> CONFIG_LSM_DISABLE in the same form as CONFIG_LSM_ORDER? I would >>>>> totally remove LoadPin's CONFIG for this in favor it. >>>> >>>> I would generally prefer an optional CONFIG_LSM_ENABLE to >>>> CONFIG_LSM_DISABLE, but I understand the logic behind your >>>> approach. I would be looking for something like >>>> >>> +1 on the CONFIG_LSM_ENABLE ove DISABLE >>> >>>> CONFIG LSM_ENABLE >>>> string "Default set of enabled LSMs" >>>> default "" >>>> >>>> as opposed to >>>> >>>> CONFIG LSM_DISABLE >>>> string "Default set of disabled LSMs" >>>> default "" >>>> >>>> where an empty string is interpreted as "use 'em all" >>>> in either case. >> >> Yes, I like CONFIG_LSM_ENABLE if "empty" means "enable all". Should >> CONFIG_LSM_ENABLE replace all the other CONFIG-based LSM >> enabling/disabling? > > I don't particularly like "empty" being "enable all". With that > how would I disable all builtin lsms so that I just boot with > capability. > > An option of all or even * is more explicit and leaves the empty > set to mean disable everything Okay, that works. I prefer "all" FWIW. -Kees -- Kees Cook Pixel Security