Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp93677imm; Thu, 20 Sep 2018 19:06:19 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbjoKAhSTzJ9O6iSaROMfH2E1i3238/MBjIj/UR0ieeM+O50/x8jqe4R77rbe4Y1FG22aZB X-Received: by 2002:a62:ed2:: with SMTP id 79-v6mr4689358pfo.198.1537495579003; Thu, 20 Sep 2018 19:06:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537495578; cv=none; d=google.com; s=arc-20160816; b=LpeWQPzs9RoQqk/5DvvboQ/SGqwq3oLzbWNjLhNK0gmMKumdBtYAdJfuA0Z8vrylOM Byv1kJHE67z+R34HRTHsD4vXo48T48kB/d8dd4ECsGNTg7DTGuaKjFAyGnWjUF0xbd7m hidlADn3gwFUKiqGBLeURJCaM5IgJC2N8kZi8R1b7CVUEccVauk1sxMsIyjFHigStqZM 2ByCin3tukxoPlwM9R+x3IFA1tz4bcTl8H+gEBzwWXPUh5K08pn1/l6zdePlQ7Euciwn Nndcqr9CidAxR9VRClt4bGSJsotI6CpYQvB4MDHUGHFe/2z1REi7PqJ/b/ZpPmTypelJ 89Cg== 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=HcH1Bb79dsNdr9yP8w5B9x9WxS2B6HZCUiq14C1WX0w=; b=cu6SIo0Mpt7yS/2v9qDslNgOT46tMS3ybiNbSIduAyhQIFHwiA4MiptyRFj+cRC188 FwOIL/7ywqMInENykb30gNYyaPTlEE8cc0nnFyaMc/JeXxA0n/cFdmMJRHKtbsGzjzEU 7A4zgmYKVBgXZXV1/eIp3zU75+Wh/GDtytV6rSETxrvg7PnblBEPAl/XdZbYbQTxjBxo 4PoBO6+xcb+xG/p43y+lIiGgbcRNDm6foy6KkUBDR8y1hqd+KRuUORJTD0EK38ujqXCE tAq/3rbrzDcZQ6ncW3eyfKbMFebjqJtNQUXdR2Um5gr5wThM6xjru/x4m17ZuTEFStjN okrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XGEUaa0G; 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 m1-v6si25009659pgq.584.2018.09.20.19.06.03; Thu, 20 Sep 2018 19:06:18 -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=XGEUaa0G; 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 S2388932AbeIUHwK (ORCPT + 99 others); Fri, 21 Sep 2018 03:52:10 -0400 Received: from mail-yb1-f195.google.com ([209.85.219.195]:35743 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388902AbeIUHwK (ORCPT ); Fri, 21 Sep 2018 03:52:10 -0400 Received: by mail-yb1-f195.google.com with SMTP id o63-v6so4818669yba.2 for ; Thu, 20 Sep 2018 19:05:40 -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=HcH1Bb79dsNdr9yP8w5B9x9WxS2B6HZCUiq14C1WX0w=; b=XGEUaa0GwktvgX4lu1yNo6BumNOPR91+Ym9t8DmjkYyGSvR6sBIjHcWMfKmfwSFnCG Y8Kxzpg4ufSlyuIEv0e+ykw+uO8KAT+N0Vts259g5DsXyJpZ/iSOs0CY8+uEntp2T91P i034xwUa/m+o55knbHbxo1lEe8WXP1H+4P6fA= 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=HcH1Bb79dsNdr9yP8w5B9x9WxS2B6HZCUiq14C1WX0w=; b=ZupTpSdtWeR40YcMUGDGyvwJXoiPD2v/fiIHJOOKc12rdOfNYwzqP03hhl/2H3WnG8 uoVf6vJf+aPCe9c5RDpdd08y0resrrdiFA9Y2iClGnlDI2B+ln/04ZWaEhBmk2AiEdVC iYiQ4GjKDcKwijJNOhyAJTdr2xFlsXPwSFDyx6cIgTTG9c2ZbaMvdgoidjfor+uoruFy ynNK4e4huiTw+5aiIhw08YS/aDxBqtK0jVxNAQ5UJAyK2bwpWOt4LpmlDp6hsX2UBad+ yi++B15mQ7o3E/+LgwqG1o8m0U0Zp99bdMKH7LIHdRNv+RBGbzFvj5MBv87ji4T/qWhN 6kbw== X-Gm-Message-State: APzg51DtOhPSuwl1f3iwUmjvxsZ4t0MhkmF2Lht9o5KpAJtswhZCCvAc EH0u5ltiQQcS8UCcOQln3hN38Z8H9wY= X-Received: by 2002:a25:9847:: with SMTP id k7-v6mr11014208ybo.255.1537495538831; Thu, 20 Sep 2018 19:05:38 -0700 (PDT) Received: from mail-yw1-f51.google.com (mail-yw1-f51.google.com. [209.85.161.51]) by smtp.gmail.com with ESMTPSA id v126-v6sm5487554ywe.45.2018.09.20.19.05.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 19:05:37 -0700 (PDT) Received: by mail-yw1-f51.google.com with SMTP id p206-v6so4594951ywg.12 for ; Thu, 20 Sep 2018 19:05:36 -0700 (PDT) X-Received: by 2002:a81:98d7:: with SMTP id p206-v6mr18722455ywg.353.1537495536374; Thu, 20 Sep 2018 19:05:36 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:5f04:0:0:0:0:0 with HTTP; Thu, 20 Sep 2018 19:05:35 -0700 (PDT) In-Reply-To: <6c899d9e-45aa-8159-c402-b3c4d1936112@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> From: Kees Cook Date: Thu, 20 Sep 2018 19:05:35 -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 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. >>>> 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? >>>> When we have full stacking, how could I compile in selinux >>>> but exclude it? >>> Yup, same problem. Same suggested solution? >>> >>> Should lsm.enable/disable= also become a comma-separated list, or >>> should I leave it as a multi-instance thing like I have it? >> >> I prefer the multi-instance >> lsm.disable=selinux lsm.disable=yama >> to the list >> lsm.disable=selinux,yama >> >> but at this point I don't really care all that much. > > the comma separated list however is consistent with what is being > done for default order Yeah, and it would match the new CONFIG_LSM_ENABLE. FWIW, it was tedious to type "lsm.enable" and "lsm.disable" over and over when doing testing, so I almost prefer the comma separated list at the end of the day. I'll ponder this a bit. -Kees -- Kees Cook Pixel Security