Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp961696imm; Fri, 14 Sep 2018 08:58:19 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbZRm8j5iJ3W8QyFRknmL3KjwHC8mytJMaL/4j656426XtaPi1psomiGMQJUTqKUsqujQgs X-Received: by 2002:a62:c90a:: with SMTP id k10-v6mr13230076pfg.180.1536940699282; Fri, 14 Sep 2018 08:58:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536940699; cv=none; d=google.com; s=arc-20160816; b=E/tPniAixaLcrsQbtda+I+qVKpXQ6Wn3GzJpOsstxTHydAdbIOkTvqR5s/XhdkVz+g YgDcj54Nq5m1JYWa4ioFsdhQ5mbfyfr4QqE8wO4CrLORhIXyPIUhnhIHnn1CrcFIHyRA lTlfSwFE1YojUEqGmdJ4hIE+/leBqNLGfqEFxEyzojZfm4Iper95y2ColKQBVthsJX+6 u/uCJmzKol9ECGjuU9o/5ei1Zaxe7SNvVdK8+qw652i7kN6pAjEA8OdyCzAQRy8UYAKI XGNh01AJh8O3MGCMvtOlxgrjFtaS5xc+zFZd5orpvjwk4pRokBWsQVcE2WJz8n4bWR8f UV2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=gao7PJ6bBOPWJNRvXaiLpLdx9SmHgbKD+8I1SyUpkuI=; b=JISG7sPjFFo8tDayQmm158JM5tK2oDYWhE+w/aOvMo5w+zMkkCjKrBb80xAq+8Kci1 I4l1fV/MUV1rW8IpH++bAgNbpJFCrWmhUqRB1Z68HtXKIcMt5cc9GGSb8bCeI+n5rFGi P1usE+kPt3ABLZ1KiwFsY57UjXVYnsS1PMh60l13QgSI5kEK2yEqTZwBgVSO3CtFGj4h 3GlaUy41CNrbZsbduf7pzdR2dNEEJeP1VsZ7Pdzz28AydwPfd+vmy/q9k8R3Kc4Zgeh7 GxrnJVsbTIRdYWlHXFZX+jFl8G7Pu70TVI0ld96EfAn+oG0eRyffoez3zA+L77qe6zjN jh9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=T9tTd7d6; 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 i21-v6si7690593pgg.513.2018.09.14.08.58.04; Fri, 14 Sep 2018 08:58:19 -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=@yahoo.com header.s=s2048 header.b=T9tTd7d6; 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 S1728127AbeINVM1 (ORCPT + 99 others); Fri, 14 Sep 2018 17:12:27 -0400 Received: from sonic306-9.consmr.mail.bf2.yahoo.com ([74.6.132.48]:41990 "EHLO sonic306-9.consmr.mail.bf2.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728076AbeINVM1 (ORCPT ); Fri, 14 Sep 2018 17:12:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1536940637; bh=gao7PJ6bBOPWJNRvXaiLpLdx9SmHgbKD+8I1SyUpkuI=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=T9tTd7d6TBLZMru15ncRyV6KMl5/FCbnu9x7gjXtqIva55WwS9MojnvxvJjg1sCNB2Yiw5sJmciF0tk6Dx4+1cA0mghp77sd+LhBwqy2gq78jb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8uutXJDeY6Vuvq9YheeKiA7dtNT6HxByE8GsSCvOS529nschBYYu.1B5atjze npao0jls_n219NL3P.FsZJO1QlkWaxxz71nJ4s4DVZXlBNXnP_VwXDz75_ajUbDZnHKmmeLMb5YY XRkz3K8d_Z2Veb.98J5yk3mPOj30Df.KqYOvrLH5Wl3zMkJh1_2sQMCIiPJEbkfb_PKyo4BzzZ15 rYDBCzRKu2iZRsWhnU2Ck6.6ZyFalgDY- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Fri, 14 Sep 2018 15:57:17 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO [192.168.0.102]) ([67.169.65.224]) by smtp431.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID a9208e24391501f37450496b3fbdb868; Fri, 14 Sep 2018 15:57:17 +0000 (UTC) Subject: Re: [PATCH 10/10] LSM: Blob sharing support for S.A.R.A and LandLock To: Kees Cook Cc: Paul Moore , linux-security-module , James Morris , LKML , SE Linux , John Johansen , Tetsuo Handa , Stephen Smalley , "linux-fsdevel@vger.kernel.org" , Alexey Dobriyan , "Schaufler, Casey" References: <99cb1ae7-8881-eb9a-a8cb-a787abe454e1@schaufler-ca.com> <5b983bba-049c-795a-3354-a2e8ab33cecf@schaufler-ca.com> From: Casey Schaufler Message-ID: <2bc5e4f5-8429-6843-f255-8fab6dacf39b@schaufler-ca.com> Date: Fri, 14 Sep 2018 08:57:07 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/13/2018 5:19 PM, Kees Cook wrote: > On Thu, Sep 13, 2018 at 5:08 PM, Casey Schaufler wrote: >> On 9/13/2018 4:57 PM, Kees Cook wrote: >>> On Thu, Sep 13, 2018 at 4:51 PM, Casey Schaufler wrote: >>>> On 9/13/2018 4:06 PM, Kees Cook wrote: >>>>> - what order should any stacking happen? Makefile? security=? >>>> Makefile by default. >>> Okay, if ordering is by Makefile and everyone dislikes my >>> $lsm.enabled=0/1 thing, then these mean the same thing: >>> >>> security=selinux,tomoyo >>> security=tomoyo,selinux >>> >>> i.e. order of security= is _ignored_ in favor of the Makefile ordering. >> No, I think that the two lines above should have a different >> execution order. If we really need to specify multiple modules >> at boot time that is what makes the most sense. >> >> It's a matter of mechanics and probably another pass during the >> init process, but it's doable. If we determine it's necessary for >> this stage it is just work. > We already have the minor LSMs that cannot change order. Are you saying that we don't have a mechanism to change the order, or that they wouldn't work right in a different order? Well, there's the capability module that has to be first. > They aren't > part of security= parsing either. True, but there's no reason now that we couldn't change that. Except for capability. Hmm. > To enable/disable LoadPin, you do > "loadpin.enabled=1/0" separate from "security=". SELinux and AppArmor have the same. > Should "blob-sharing" LSMs be like major LSMs or minor LSMs? I like the idea of changing the minor modules to do the full registration process. That would make them all the same. Except for capability. In any case, the "blob-sharing" LSMs need to do the full registration process to account for their blobs sizes, and that brings the "major" behavior along with it. > If someone is booting with "security=selinux,tomoyo" and then SARA > lands upstream, does that person have to explicitly add "sara" to > their boot args, since they're doing a non-default list of LSMs? Yes. security= is explicit. > (I actually prefer the answer being "yes" here, FWIW, I just want to > nail down the expectations.) For now let's leave the minor (capability, yama, loadpin) as they are, and require all new modules of any flavor to use full registration. We could consider something like security=$lsm # Stack with $lsm at priority 2 - Existing behavior $lsm.stacked=N # Add $lsm to the stack at priority N. Delete if N == 0 It's OK to specify "selinux.stacked=2" and "sara.stacked=2". Which gets called first is left up to the system to decide. Whatever the behavior is gets documented. Capability will always be first and have priority 1. It's OK to specify "smack.stacked=1". The default stack is determined by CONFIG_SECURITY_$lsm_STACKED at build time. CONFIG_SECURITY_$lsm_STACKED changes from a boolean to an integer value to establish the default hook order. /sys/kernel/security/lsm reports the modules in hook call order. /sys/kernel/security/lsm-stack reports the list with the hook call priority capability:1,yama:1,selinux:1,sara:5,landlack:17 If stacking is not configured $lsm.stacked=0 is treated as security=none. For other values of N $lsm.stacked=N is treated as security=$lsm.