Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1139192rwd; Wed, 31 May 2023 09:56:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ij7j0w/MJ7pQw+kcPVZOTeSj4wRz1SoaoSfRcjVfhdEC9ostFgSwFl2ZnNPiiN4Tb9n74 X-Received: by 2002:a05:6a20:7f9f:b0:111:1bd6:2731 with SMTP id d31-20020a056a207f9f00b001111bd62731mr6947728pzj.7.1685552186010; Wed, 31 May 2023 09:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685552185; cv=none; d=google.com; s=arc-20160816; b=IRgiM3RcvNfNmfwzIV4WvWdPqDc3xI8UPWtIz469cDXqoc41x2PHF0qhQN8JS4B0n5 vU6RD80ExNVxN2xX1bS6LQ1B0QW9+dzwflYBjq4hMbJ77y0smPd/l7UYIhg6HI8awWs6 j6u0BbQOWDKQ4L8cOyDXyxaHq1XA7CLDRnxr2/DWrlrpfzSvICIfUzFpsRU55TsjOG0f YvkU4PjdCNrmYpmyU99+eDZLF4Ui3avYe17/ArP8HP2UvlfpZgPMs6jvFGmrY+WeHpoI VqSZ/l6x3Azk938sIyy9EbQW+grd9LX6pNJJlcvOKSYKHmIojZKvA9YSfyOvz5votwGV M4oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=SJR338Vf7dbzf8RVV8TS187vO7lAXnTfCx/UpAwzXyM=; b=qPXFUZHZ/rKUdPyioAqo+ypIgO8Pg+zt74ruQ8mCqLICFRaq4/WDBbPTitxgFNWZQe R/uCxIPKTlJ03GAej22P2k0mTi+bqF9CnkY7wbP70cBVcRr17palcUq/OBfaPG7QReaN +ZVZ9jzbFb5vuOBURwXu+SWJcG1i9P3oJDGwv0HyefyNB0BMUnwkDmyipeH6LY06P2Nm a4uddPfidUigsoE78YqQrnmSMLa3W/gYfZZZDNiVIUyQYlYS1GTIvh+6uyDlJZ9PT6FC niv5aIufR3IMqSyHA0nxiNHQSyMGdchREtgoJLqNIW9Z7pFXBow/pnSDOLpOq+t25o8i lr+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=h6ENdfUL; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-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 l25-20020a637019000000b00502d825633asi1182225pgc.639.2023.05.31.09.56.02; Wed, 31 May 2023 09:56:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=@yahoo.com header.s=s2048 header.b=h6ENdfUL; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229884AbjEaQpL (ORCPT + 99 others); Wed, 31 May 2023 12:45:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229875AbjEaQpJ (ORCPT ); Wed, 31 May 2023 12:45:09 -0400 Received: from sonic309-27.consmr.mail.ne1.yahoo.com (sonic309-27.consmr.mail.ne1.yahoo.com [66.163.184.153]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8C36135 for ; Wed, 31 May 2023 09:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1685551506; bh=SJR338Vf7dbzf8RVV8TS187vO7lAXnTfCx/UpAwzXyM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=h6ENdfUL8Awu+gBFaLkD+hzgCZvGXf1Wm9Ulgr74RtQHU/WA3+PS1hKxHX6CFWZmnkt2oFguW9ZroWgOrCy3nC36M0iBrePmm8lFk5FOPAp9G4mFyt8wBDVXHqaonjg/7QZhG+ErZlZxmj6fl90Z9DUrbdt2GFDzyQmYHGnVH3rEnOkTqdlPyuPmAVyfgrFt/V1pTU+0YG8mCFsTUP3iFQP+7jJUZLzkcpYCFMKQAAXLCQVcDS2AQd6scMPQyiMphL51R6IUKgNEhEvjivG8dJMIzxPUm+FKkNbTd9hqsnIhwIx8r+fmIsfE4pON8OtI7FVQqIye7wUhrqx5NQ8z9w== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1685551506; bh=IK4gslOeWW2xAgwNjF79sSMMDJ4aQyoyJI3YquDYDcv=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=jAWtEHJmvhubeBSmTqB0ckEPwUfFwywMKrCd0VAkbvfBOp93YxujbLeAq7uvJKzveVsUhcVLdoia1nkMTeFpwSXnKDVWGivZdQVzISUug+BmNDRPUf+pIOu4rcEvE2bc3IWJjDXrtGS/pu5BMyFaPlFbfHVq0iv6PYk2s9hIcpJE68x471JZk5aYw6l0wy0VfUqBXw/yoFTlxJA8u9WUgDAUhPGJu67B16gR8Ym35UbijnOSlYOlp0mnWyMC0SgSm0K/eHKWx+1wCNTy4lD0vw+nPAXLYoimbaUiQltt8nTub7zPY5Y1czAwbgVEyH9mJZ6HTY0j7Be3XTL6wP++Ww== X-YMail-OSG: rgeBCO8VM1ljf.g_Q8Uu4HS_ZUmEYXBNHKGjxGFeFP1zXRQjSTRHN8nmK_t3Ghh KfhjA97dsyErTNGzb2iQztk4XpI4plX8XNrAM9thC2YfJ83o1aid48x._U7bunTfYF22kKAfC86W pihY_Kd_AyLJwDspxCPJU7x2yz6Ww9ihlz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vu2g1HCLei.KGpQQbiVMWnf5h0lI9u2Miuty4g X-Sonic-MF: X-Sonic-ID: 3dc95e55-b757-4320-819b-cea79f802ef0 Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ne1.yahoo.com with HTTP; Wed, 31 May 2023 16:45:06 +0000 Received: by hermes--production-ne1-574d4b7954-xz2cn (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 803444bd8cafbcfff4fb75f278168acc; Wed, 31 May 2023 16:45:02 +0000 (UTC) Message-ID: <498f8719-219d-b4cf-8231-54d7fb6a58dd@schaufler-ca.com> Date: Wed, 31 May 2023 09:44:58 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH -next 0/2] lsm: Change inode_setattr() to take struct Content-Language: en-US To: Christian Brauner Cc: Christoph Hellwig , =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= , Xiu Jianfeng , gregkh@linuxfoundation.org, rafael@kernel.org, viro@zeniv.linux.org.uk, dhowells@redhat.com, code@tyhicks.com, hirofumi@mail.parknet.co.jp, linkinjeon@kernel.org, sfrench@samba.org, senozhatsky@chromium.org, tom@talpey.com, chuck.lever@oracle.com, jlayton@kernel.org, miklos@szeredi.hu, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, stephen.smalley.work@gmail.com, eparis@parisplace.org, dchinner@redhat.com, john.johansen@canonical.com, mcgrof@kernel.org, mortonm@chromium.org, fred@cloudflare.com, mpe@ellerman.id.au, nathanl@linux.ibm.com, gnoack3000@gmail.com, roberto.sassu@huawei.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com, ecryptfs@vger.kernel.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, wangweiyang2@huawei.com, Casey Schaufler References: <20230505081200.254449-1-xiujianfeng@huawei.com> <20230515-nutzen-umgekehrt-eee629a0101e@brauner> <75b4746d-d41e-7c9f-4bb0-42a46bda7f17@digikod.net> <20230530-mietfrei-zynisch-8b63a8566f66@brauner> <20230530142826.GA9376@lst.de> <301a58de-e03f-02fd-57c5-1267876eb2df@schaufler-ca.com> <20230530-tumult-adrenalin-8d48cb35d506@brauner> <28f3ca55-29ea-4582-655d-2769881127ad@schaufler-ca.com> <20230531-endpreis-gepflanzt-80a5a4a9c8d6@brauner> From: Casey Schaufler In-Reply-To: <20230531-endpreis-gepflanzt-80a5a4a9c8d6@brauner> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailer: WebService/1.1.21495 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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-nfs@vger.kernel.org On 5/31/2023 1:36 AM, Christian Brauner wrote: > On Tue, May 30, 2023 at 03:15:01PM -0700, Casey Schaufler wrote: >> On 5/30/2023 9:01 AM, Christian Brauner wrote: >>> On Tue, May 30, 2023 at 07:55:17AM -0700, Casey Schaufler wrote: >>>> On 5/30/2023 7:28 AM, Christoph Hellwig wrote: >>>>> On Tue, May 30, 2023 at 03:58:35PM +0200, Christian Brauner wrote: >>>>>> The main concern which was expressed on other patchsets before is that >>>>>> modifying inode operations to take struct path is not the way to go. >>>>>> Passing struct path into individual filesystems is a clear layering >>>>>> violation for most inode operations, sometimes downright not feasible, >>>>>> and in general exposing struct vfsmount to filesystems is a hard no. At >>>>>> least as far as I'm concerned. >>>>> Agreed. Passing struct path into random places is not how the VFS works. >>>>> >>>>>> So the best way to achieve the landlock goal might be to add new hooks >>>>> What is "the landlock goal", and why does it matter? >>>>> >>>>>> or not. And we keep adding new LSMs without deprecating older ones (A >>>>>> problem we also face in the fs layer.) and then they sit around but >>>>>> still need to be taken into account when doing changes. >>>>> Yes, I'm really worried about th amount of LSMs we have, and the weird >>>>> things they do. >>>> Which LSM(s) do you think ought to be deprecated? I only see one that I >>> I don't have a good insight into what LSMs are actively used or are >>> effectively unused but I would be curious to hear what LSMs are >>> considered actively used/maintained from the LSM maintainer's >>> perspective. >> I'm not the LSM maintainer, but I've been working on the infrastructure >> for quite some time. All the existing LSMs save one can readily be associated >> with active systems, and the one that isn't is actively maintained. We have >> not gotten into the habit of accepting LSMs upstream that don't have a real >> world use. >> >>>> might consider a candidate. As for weird behavior, that's what LSMs are >>>> for, and the really weird ones proposed (e.g. pathname character set limitations) >>> If this is effectively saying that LSMs are licensed to step outside the >>> rules of the subsystem they're a guest in then it seems unlikely >>> subsystems will be very excited to let new LSM changes go in important >>> codepaths going forward. In fact this seems like a good argument against >>> it. >> This is an artifact of Linus' decision that security models should be >> supported as add-on modules. On the one hand, all that a subsystem maintainer >> needs to know about a security feature is what it needs in the way of hooks. >> On the other hand, the subsystem maintainer loses control over what kinds of >> things the security feature does with the available information. It's a >> tension that we've had to deal with since the Orange Book days of the late >> 1980's. The deal has always been: >> >> You can have your security feature if: >> 1. If I turn it off it has no performance impact >> 2. I don't have to do anything to maintain it >> 3. It doesn't interfere with any other system behavior >> 4. You'll leave me alone >> >> As a security developer from way back I would be delighted if maintainers of >> other subsystems took an active interest in some of what we've been trying >> to accomplish in the security space. If the VFS maintainers would like to >> see the LSM interfaces for file systems changed I, for one, would like very >> much to hear about what they'd prefer. > What is important for us is that the security layer must understand and > accept that some things cannot be done the way it envisions them to be > done because it would involve design compromises in the fs layer that > the fs maintainers are unwilling to make. The idea to pass struct path > to almost every security hook is a good example. Yes, and that's completely acceptable. What would be really great is some guidance about what to do instead. Fishing for NAKs isn't fun for anybody. > If the project is feature parity between inode and path based LSMs then > it must be clear from the start that this won't be achieved at the cost > of mixing up the layer where only dentries and inodes are relevant and > the layer where struct paths are most relevant. Which is a fair point, and helps those of us who don't work in the VFS layer daily understand the rationale. > >> We do a lot of crazy things to avoid interfering with the subsystems we >> interact with. A closer developer relationship would be most welcome, so >> long as it helps us achieve or goals. We get a lot of complaints about how >> LSM feature perform, but no one wants to hear that a good deal of that comes >> about because of what has to be done in support of 1, 2 and 3 above. Sometimes >> we do stoopid things, but usually it's to avoid changes "outside our swim lane". > I personally am not opposed to comment on patches but they will > naturally have lower priority than other things. I can't say that I see how security features "naturally have lower priority", but everyone has to balance things.