Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp32348imi; Wed, 20 Jul 2022 16:22:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sQXCwT75JpVK0nKcxhzBKDSKsjOqnN2KeqnjrvGE7bopMcdSnD2vepGMg4EKzU7ZD1arfA X-Received: by 2002:a05:6402:104f:b0:43b:a44b:cff3 with SMTP id e15-20020a056402104f00b0043ba44bcff3mr11064487edu.140.1658359341515; Wed, 20 Jul 2022 16:22:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658359341; cv=none; d=google.com; s=arc-20160816; b=Ve2M2WNAEX3pfWDYhbsBRQjHzKzIGYJPVhwrtQOuKt/GkvZURJYOAkAHbQEkXAX1c0 IhopJGax1C0HMKXcipwL8hyPVswsj0GFJudZbcSN8RxjRhVl0/CCD2AegCphIQlcsa6U L4RRjftWw9Uz0U6E/HY1hRDx7fVdtklAtNslOigpI7jG+2mYUZ3ZlKvahQtrSnDM/jON ouUZuiRlH4gKfj0Fsvde9ZG2435KM0HK3sh45eo7CwsAQw5JTLaOJtMw1GJImfXbxCRC d+D7jubzRro7VNz7+pBBgth58mcbB6c/pYBoMeEwYxnbCr5IUylQeqV0tSjHKFJlYHMT THcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=gjQxo0hKIVF1YVkSJ8Tt3ejloLl3VpIsO9hirXnFH+U=; b=pcCTaMzKxShEImEFMSai7AfE3k7kpSA1mCbYluPEnJNOFynS3cJaNWnC8BNTyKtF3I zYqfv6qg7nvHDzlPqSKr6TzxwY47WFU6ONmalHrWrN7s5NB6r9hby8751mjZlWrBts8E CAZ3BOBQo5PWovxLpKUPzMaov0Qy2xnL+UAj/a/0829KDDrLd40+/NqfEfO6bcmEtGEa n41Qdi7JbNpUnQwhxXKQYae1+3dq8RGzpC/bjewbgF66d/CoPeialzcWUbRTXULfwdFK Gz+QF7KUxmoEIhk3Cm5mzTOO2o1y1CyJd2/blWsMUSRFW83GcO+7XKA9hG7AXkQVVMH6 NXEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b="zI4b6Z/w"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb2-20020a1709071c8200b0072b4afe43ddsi595509ejc.626.2022.07.20.16.21.27; Wed, 20 Jul 2022 16:22:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b="zI4b6Z/w"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230513AbiGTWjW (ORCPT + 99 others); Wed, 20 Jul 2022 18:39:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230477AbiGTWjT (ORCPT ); Wed, 20 Jul 2022 18:39:19 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B925B24F22 for ; Wed, 20 Jul 2022 15:39:17 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id n12so15196124wrc.8 for ; Wed, 20 Jul 2022 15:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=gjQxo0hKIVF1YVkSJ8Tt3ejloLl3VpIsO9hirXnFH+U=; b=zI4b6Z/wGUUgwWeOD3pQ7dMozzrzLOSSr5UB4/ki36H/h/zC0Qb1NCR/RhxeQdHB+Z 3FCKUbPYT5+bU3pmhLvpKxSDvhXulocHKjQJIK9p2OWuINXr0ivOwxxFVq8r2AsYJL0k h2jIEJlNGTvnLKbR2B1DBtIZIcqD7gzg4o3ocXh3FpoC1frMzUOTzgFrhv924XvD3qy6 bGkXIyFJEC3lxyxyiCQL50o2Lakud4qBn1yd2/Ofteeaj17Q+3Q2Y9JWICUkKp2nG3tu nmWKI3COxvtxiKvkkyvYG9tb5TN1DQ3EJhT9fkaryBkGsfd6tZY/Q5QUvQapNTufNH1C bPlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=gjQxo0hKIVF1YVkSJ8Tt3ejloLl3VpIsO9hirXnFH+U=; b=ScL8m0Er1YdsXCc054L9F/ivBV5OY2VstZZ/aYfzRtur1RM1l7OcsqYHylR/9GqPNo iEkxd5GFRBQZxrE3lEOUcBP12pARwloOI7U8FR1daD5tOIYuoBfuyRuyQ7PKimgTvu2n ODepx4iLwrwLesg2tmbshZNNGPpaqslmEYYXA9ng8cvX1WHvSJSM26z7UajZlf3EMmgl 4bOfhZHmC/LiME9gD/CXU/dmo2u7rgUaoqyn+m+79+MLOfXi5ohtFbSA3jaM67wC6qas vl8C5Lp8kVBLQInGHmclrpv0GtyZgJzOBlRO/ztMSd9kReykGExZ6KI1KtF3WizGH9pP khhQ== X-Gm-Message-State: AJIora9A56vwFGnH5OY5M8579huyPLADqXFyxdL6crPUExTeLbuhB64/ cnRZ8QGIFkIBRxApbkJPWW3MCwZZKGzIIPU38EhY X-Received: by 2002:adf:e492:0:b0:21e:45af:5070 with SMTP id i18-20020adfe492000000b0021e45af5070mr5887107wrm.483.1658356756213; Wed, 20 Jul 2022 15:39:16 -0700 (PDT) MIME-Version: 1.0 References: <20220707223228.1940249-1-fred@cloudflare.com> <3dbd5b30-f869-b284-1383-309ca6994557@cloudflare.com> <84fbd508-65da-1930-9ed3-f53f16679043@schaufler-ca.com> In-Reply-To: From: Paul Moore Date: Wed, 20 Jul 2022 18:39:05 -0400 Message-ID: Subject: Re: [PATCH v2 0/4] Introduce security_create_user_ns() To: Casey Schaufler Cc: Frederick Lawler , =?UTF-8?Q?Christian_G=C3=B6ttsche?= , KP Singh , revest@chromium.org, jackmanb@chromium.org, Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , James Morris , "Serge E. Hallyn" , Stephen Smalley , Eric Paris , shuah@kernel.org, Christian Brauner , "Eric W. Biederman" , bpf@vger.kernel.org, linux-security-module@vger.kernel.org, SElinux list , linux-kselftest@vger.kernel.org, Linux kernel mailing list , netdev@vger.kernel.org, kernel-team@cloudflare.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 20, 2022 at 5:42 PM Casey Schaufler wr= ote: > On 7/19/2022 6:32 PM, Paul Moore wrote: > > On Fri, Jul 8, 2022 at 12:11 PM Casey Schaufler wrote: > >> On 7/8/2022 7:01 AM, Frederick Lawler wrote: > >>> On 7/8/22 7:10 AM, Christian G=C3=B6ttsche wrote: > >>>> ,On Fri, 8 Jul 2022 at 00:32, Frederick Lawler > >>>> wrote: ... > >>>> III. > >>>> > >>>> Maybe even attach a security context to namespaces so they can be > >>>> further governed? > >> That would likely add confusion to the existing security module namesp= ace > >> efforts. SELinux, Smack and AppArmor have all developed namespace mode= ls. > > > > I'm not sure I fully understand what Casey is saying here as SELinux > > does not yet have an established namespace model to the best of my > > understanding, but perhaps we are talking about different concepts for > > the word "namespace"? > > Stephen Smalley proposed a SELinux namespace model, with patches, > some time back. It hasn't been adopted, but I've seen at least one > attempt to revive it. You're right that there isn't an established > model. If it isn't in the mainline kernel, it isn't an established namespace model= . I ported Stephen's initial namespace patches to new kernels for quite some time, look at the working-selinuxns branch in the main SELinux repository, but that doesn't mean they are ready for upstreaming. Aside from some pretty critical implementation holes, there is the much larger conceptual issue of how to deal with persistent filesystem objects. We've discussed that quite a bit among the SELinux developers but have yet to arrive at a good-enough solution. I have some thoughts on how we might be able to make forward progress on that, but it's wildly off-topic for this patchset discussion. I mostly wanted to make sure I was understanding what you were referencing when you talked about a "SELinux namespace model", and it is what I suspected ... which I believe is unrelated to the patches being discussed here. > >> That, or it could replace the various independent efforts with a singl= e, > >> unified security module namespace effort. > > > > We've talked about this before and I just don't see how that could > > ever work, the LSM implementations are just too different to do > > namespacing at the LSM layer. > > It's possible that fresh eyes might see options that those who have > been staring at the current state and historical proposals may have > missed. That's always a possibility, and I'm definitely open to a clever approach that would resolve all the current issues and not paint us into a corner in the future, but I haven't seen anything close (or any serious effort for that matter). ... and this still remains way off-topic for a discussion around adding a hook to allow LSMs to enforce access controls on user namespace creation. > > If a LSM is going to namespace > > themselves, they need the ability to define what that means without > > having to worry about what other LSMs want to do. > > Possibly. On the other hand, if someone came up with a rational scheme > for general xattr namespacing I don't see that anyone would pass it up. Oh geez ... Namespacing xattrs is not the same thing as namespacing LSMs. LSMs may make use of xattrs, and namespacing xattrs may make it easier to namespace a given LSM, but I'm not aware of an in-tree LSM that would be magically namespaced if xattrs were namespaced. This patchset has nothing to do with xattrs, it deals with adding a LSM hook to implement LSM-based access controls for user namespace creation. --=20 paul-moore.com