Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1177716imm; Thu, 4 Oct 2018 09:19:07 -0700 (PDT) X-Google-Smtp-Source: ACcGV63uAuoJ59cCrmHHuk7X2E0UxccyOJ+iOWvBcBHYZ5KyXXOlsxaXWpe/muQf12MYxSW5KIOZ X-Received: by 2002:a63:e918:: with SMTP id i24-v6mr6396471pgh.64.1538669947054; Thu, 04 Oct 2018 09:19:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538669947; cv=none; d=google.com; s=arc-20160816; b=tBjOovRHyKBD42ham7kMidAoy2x4NjnCLEf6tQmtvDAZiikln+rGIZVExuUZmC/f3e 8MEr95e4DMadkOm07TNLAcB2STwDZoiR2WYzb+fWQC0M441/AlfW8ZJt+Gznk+GWmkCT zLmMwW3iVxWTC9QxsHYI1eirY+C+/tYrIktjAHQB18Hviy+r//KXahqZRBAqWETtjgxd H4GN/EFa0ayIfvymbFhLki6BYdo83ln4z/RMOnInIBfLk6s6tvAKZFu50ez3tWekh5uy mxgy05LDF8B53+8Dbwavdm8geYIYwB1u4IxoCHFPncZfaguJYvFYeDFe9xPa24yrA4JT XvvA== 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=klikc/ppoWhHWoTPwATe/d3YAeCUULUa19nJC8jVpk4=; b=yVWhFN6PRLnFt3+OMjzMGonF6TtfMx709b1K/OvPX5/opbeZqnpMz2sG4DsIzOuiKe 6aSgDjxHoidMExHOr0gQiNV/Hv22XR7tS0caWgzP1dQoP0UG3dhbxKwCHkmIXimnO0l4 +7DfB6jWZGnwMici57IGyw2kF1RxADCxV8xs0l+jXRLm88RkHjCBIy1kHLPJ3PouA2k3 3kE2Idf4GYl5uOyF+J2iLXZHsasn1dqUDzrMyBGEibjqUd0JJhX6/rIpWDOyK5KuYXe7 c1cG34eB/AnaSoJoTuznGDGxJwNQBfTC85xDymvgLELH+eASR/SmFmdCzo4sOQJCaV7e sPNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kG5QhKQi; 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 y34-v6si5266380pgk.479.2018.10.04.09.18.52; Thu, 04 Oct 2018 09:19:07 -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=kG5QhKQi; 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 S1727705AbeJDXMn (ORCPT + 99 others); Thu, 4 Oct 2018 19:12:43 -0400 Received: from mail-yw1-f42.google.com ([209.85.161.42]:37569 "EHLO mail-yw1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727614AbeJDXMn (ORCPT ); Thu, 4 Oct 2018 19:12:43 -0400 Received: by mail-yw1-f42.google.com with SMTP id y14-v6so3995305ywa.4 for ; Thu, 04 Oct 2018 09:18:45 -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=klikc/ppoWhHWoTPwATe/d3YAeCUULUa19nJC8jVpk4=; b=kG5QhKQiXbODahJrteU88ImIM3Gdefjzn39Ql04hsa85oIqg7rheUSWXuwlMoldiMN FWm+elTP8aX3dgn08TLtTiswx17TJHuHOgpOiYn2P8fAVOOQdu47PFcD8PHZOXZjMZ5K qoNi7nkRrmowNiZmDx5tvSSQVnd2//ArTBVUA= 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=klikc/ppoWhHWoTPwATe/d3YAeCUULUa19nJC8jVpk4=; b=T7ysNDMtPnhxZIVWk2mSoRdZXDuW4jvvxMdEqAv1xa8ZjgBJo7T3dmWs370mt73wgH nklNyqIF5Th25PVRCX3Lx+I4FkJZOfyOLnmWvyn1dUu0xZTqi6a+//7IZiubGO8XBQ21 hjqS4dnG9LXNJL6K5oQ/xxnr7pm5MiUffs3jl4bAjAelV/fYDXV7iIX+LOKQlO6UsQac IbAiuryI8XQ1Z2VyN03+xuAcFVOm7YT9jJVbSbdRBe4gpo0FqUpys8tGysq1JoAXtvfY DDR9NwieUKFnmeLX44CuVWOAYTb0gmpb6CNoxO39pUevJ1d8FfFBAqNBPLTpirYd6obW OKFw== X-Gm-Message-State: ABuFfojDo0/d0KogqWp1ycsvpJRxG8MdTo6EAcU4bkNvtcKBQbqccn5E lojP51QkgC21ibxGnwibL55ti+rum+s= X-Received: by 2002:a81:8505:: with SMTP id v5-v6mr3968949ywf.493.1538669923725; Thu, 04 Oct 2018 09:18:43 -0700 (PDT) Received: from mail-yw1-f50.google.com (mail-yw1-f50.google.com. [209.85.161.50]) by smtp.gmail.com with ESMTPSA id j8-v6sm3374098ywa.17.2018.10.04.09.18.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Oct 2018 09:18:42 -0700 (PDT) Received: by mail-yw1-f50.google.com with SMTP id j75-v6so3989492ywj.10 for ; Thu, 04 Oct 2018 09:18:41 -0700 (PDT) X-Received: by 2002:a0d:fec6:: with SMTP id o189-v6mr4141380ywf.237.1538669921384; Thu, 04 Oct 2018 09:18:41 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:d116:0:0:0:0:0 with HTTP; Thu, 4 Oct 2018 09:18:40 -0700 (PDT) In-Reply-To: References: <20181002005505.6112-1-keescook@chromium.org> <809f1cfd-077b-ee58-51ba-b22daf46d12b@tycho.nsa.gov> <5955f5ce-b803-4f58-8b07-54c291e33da5@canonical.com> From: Kees Cook Date: Thu, 4 Oct 2018 09:18:40 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH security-next v4 23/32] selinux: Remove boot parameter To: John Johansen , James Morris Cc: Jordan Glover , Stephen Smalley , Paul Moore , Casey Schaufler , Tetsuo Handa , "Schaufler, Casey" , linux-security-module , 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 Wed, Oct 3, 2018 at 10:56 PM, John Johansen wrote: > On 10/03/2018 01:36 PM, Kees Cook wrote: >> I still think we should have all built LSMs enabled by default, with >> CONFIG_LSM_DISABLE available to turn stuff off. CONFIG_LSM_ORDER > > and this as a distro ubuntu does not want. > Ubuntu wants to make yes available by building them in, but does NOT > want all the LSM enabled by default, not even necessarily all minor LSMs. > > As a distro we want a supported set as default, and users can opt-in > to new LSMs. If a new LSM comes along we don't want it enabled by > default, which happens Using the lsm disable approach. Okay, but order still matters. Where, in the order, should a disabled LSM go? It seems like the friendliest approach for an end-user would be to do something like lsm=+landlock and it all works correctly. That user doesn't need to know about ordering or the distro default LSMs. They just want to _add_ landlock. They want all the other LSMs to still be present, and they want the distro to have chosen where landlock is in the ordering. >> I should also note that I don't want to leave CONFIG_DEFAULT_SECURITY >> in, since it's just a way to disable all the other majors. I don't >> like this because it will force LSMs to be disabled that don't need to >> be once blob-sharing lands. The whole point of this series is to get >> us away from fixed ordering and thinking about "major" vs "minor" and >> towards "exclusive" or not, where we can continue to slowly chip away >> at exclusivity without breaking anything. >> > sure we definitely want to get away form "major" vs "minor" and in > generally even exclusive, except where to LSMs just can't live > with each other. > > But that doesn't mean dropping something like default security. The > mistake with the current DEFAULT_SECURITY was that it only applied > to major LSMs, not the minor ones. Right, we need to expand it to include a full description of ordering and enablement. How about this: CONFIG_LSM specifies order and enablement status. For example: CONFIG_LSM=yama,loadpin,apparmor,!selinux This means init order is yama, loadpin, apparmor, selinux, but selinux is disabled. Anything not listed in CONFIG_LSM but built in will be disabled and ordered in link-order. (i.e. an implicit trailing "!smack,!tomoyo".) Then we add "lsm=" which understands modifiers "-", and "+". "lsm=-apparmor,+selinux" wouldn't change ordering, but would disable apparmor and enable selinux. "lsm=smack,loadpin" would enable only smack and loadpin, in that order and disable everything else. I don't want to overload "security=", but we can if we want. It would be as above, but a trailing comma would be needed to trigger the "ordering" behavior. e.g. "security=selinux" would disable all other majors (retaining the current behavior), but "security=selinux," would disable all other LSMs. -Kees -- Kees Cook Pixel Security