Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3578674pxb; Mon, 21 Feb 2022 00:53:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0F2wuGyuorMaXn06O0qtgpuoMSNEEZQVc/kitQfA155N6873IeLCUnLGIBOI87DFxZJkr X-Received: by 2002:a17:906:ccda:b0:6a8:49b8:d2ad with SMTP id ot26-20020a170906ccda00b006a849b8d2admr14791332ejb.257.1645433617424; Mon, 21 Feb 2022 00:53:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645433617; cv=none; d=google.com; s=arc-20160816; b=G8CCam4VERenxx8eMK/fZzXT6+rg7JrFlWKkBAv/c/JrKYvHXaulU26oMWo5iWAZBN gtf4NefpQRICLub/kzyH42qUIcKpBBiQmMDuovFQ35xRDp/aEcuvnNzoE+v/qoymRnkV vZc53qKwem+KZlEaZ8SiDIrmQ9VvA2nQxQKxLPGY6rmvEX19EjYxfIMYusyxu0k+RcpP 7d7Dh5ChNvEk7B4bzTOUfqoIstNiUMxxKchmyMM0V+zmjOUcbyEqvGNjfBCWw0buJks+ Xnxz/lzG5fS5BZwiw8bzn0uHLKqkuf729sqfX00xO0ozSxBWxHyQMEjBRr9Su4bpcZzX aAsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=WSjCP5+WYHiF+B1HkYBif0Pu32QG6Ze6TvgqD0vawac=; b=f1NHtzwgkHkcRYOaFlRF5l9w++w+ne32msuFaS3tDxxHOaSTd8Do7fidQPyatDwS+6 bQ56n88s5Yw3KxAyhtc/YUvEOAJSdCLr8zOQv8Yay3yTlHXHycf4bBb4A3mqmnIu0fux Lej8jxlcthRheslMxtBWqelpTYCsjpBAiPx/gUpkE1xSGR7n8BJIvhHrHcsD/Xwdqfyt 4KlQdxgodw7wqGcmATcCg4Ny9up3xGHORxFGIvKLrBx/5lnPUPXXDzb5+J2f/aZI6Ubn 9P73cVJIqizsvnKAlGw6pqwYhG3sRGKlEC99HSDnE0xxuNdS0bz6G12jSI0nTK7Jsq8a AX3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F1BjTKNG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bo21si6319798edb.214.2022.02.21.00.53.14; Mon, 21 Feb 2022 00:53:37 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=F1BjTKNG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238581AbiBSLei (ORCPT + 99 others); Sat, 19 Feb 2022 06:34:38 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238736AbiBSLeh (ORCPT ); Sat, 19 Feb 2022 06:34:37 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A70E050454 for ; Sat, 19 Feb 2022 03:34:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4B462B80758 for ; Sat, 19 Feb 2022 11:34:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6631C004E1; Sat, 19 Feb 2022 11:34:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645270457; bh=QHo5BZzDWJoq9QDW49R+XLww9yjbYUAE/e5wemGHijA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=F1BjTKNGwNLJSwYKjvcGL3A4wFpaiN1WY2H4XJZrhb65LvjNufDlnpePg9auWVNZd ztTJyxh+HRM+QN5H3QvUiw86MUQLixU8f3q4fSnSLUHpbZjDCl8DO0gQOhJ3fd/7st CsqVy9fzZJPQseqIp0ytoH13MB1zbKFXRSUrPQhVAHNYyYcwhWQU0hEJ8HbhyCx2E7 I91UQU0S6PoTPie9S28osdL+rUBjvz2DsJHy3+wghiBMHo+k5C4a5cwGT3ZqjYlhXT EZz720BSn6LwgtsLOGnOiwW4vKuhvQiFUO3FrqCsNPpmTHSVt+x9EPLnmosBZgXyK8 qeeDHalNc68vw== Date: Sat, 19 Feb 2022 12:34:12 +0100 From: Christian Brauner To: "suy.fnst@fujitsu.com" Cc: "linux-nfs@vger.kernel.org" , "l@damenly.su" , "brauner@kernel.org" Subject: Re: [bug?] nfs setgid inheritance Message-ID: <20220219113412.7ov4tbkisv4vnmo3@wittgenstein> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Sat, Feb 19, 2022 at 08:34:30AM +0000, suy.fnst@fujitsu.com wrote: > Hi NFS folks, > During our xfstests, we found generic/633 fails like: > ============================================ > FSTYP -- nfs > PLATFORM -- Linux/x86_64 btrfs 5.17.0-rc4-custom #236 SMP PREEMPT Sat Feb 19 15:09:03 CST 2022 > MKFS_OPTIONS -- 127.0.0.1:/nfsscratch > MOUNT_OPTIONS -- -o vers=4 127.0.0.1:/nfsscratch /mnt/scratch > > generic/633 0s ... [failed, exit status 1]- output mismatch (see /root/xfstests-dev/results//generic/633.out.bad) > --- tests/generic/633.out 2021-05-23 14:03:08.879999997 +0800 > +++ /root/xfstests-dev/results//generic/633.out.bad 2022-02-19 16:31:28.660000013 +0800 > @@ -1,2 +1,4 @@ > QA output created by 633 > Silence is golden > +idmapped-mounts.c: 7906: setgid_create - Success - failure: is_setgid > +idmapped-mounts.c: 13907: run_test - Success - failure: create operations in directories with setgid bit set > ... > (Run 'diff -u /root/xfstests-dev/tests/generic/633.out /root/xfstests-dev/results//generic/633.out.bad' to see the entire diff) > Ran: generic/633 > Failures: generic/633 > Failed 1 of 1 tests > ============================================ > > The failed test is about setgid inheritance. > When a file is created with S_ISGID in the directory with S_ISGID, > NFS doesn't strip the setgid bit of the new created file but others > (ext4/xfs/btrfs) do. They call inode_init_owner() which does > the strip after new_inode(). > However, NFS has its own logical to handle inode capacities. > As the test says the behavior can be filesystem type specific, > I'd report to you NFS guys and ask whether it's a bug or not? Thanks for the report. I'm not sure why NFS would have different rules for setgid inheritance. So I'm inclined to think that this is simply a bug similar to what we saw in xfs and ceph. But I'll let the NFS folks determine that. XFS is only special in so far as it has a sysctl that lets it alter sgid inheritance behavior. And it only has that to allow for legacy irix semantics iiuc. Christian