linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "suy.fnst@fujitsu.com" <suy.fnst@fujitsu.com>
To: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Cc: "l@damenly.su" <l@damenly.su>,
	"christian.brauner@ubuntu.com" <christian.brauner@ubuntu.com>
Subject: [bug?] nfs setgid inheritance
Date: Sat, 19 Feb 2022 08:34:30 +0000	[thread overview]
Message-ID: <OS3PR01MB770539462BE3E7959DAF8B5789389@OS3PR01MB7705.jpnprd01.prod.outlook.com> (raw)

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.

--
Su

             reply	other threads:[~2022-02-19  8:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-19  8:34 suy.fnst [this message]
2022-02-19 11:34 ` [bug?] nfs setgid inheritance Christian Brauner
2022-02-19 17:00   ` Trond Myklebust
2022-02-23  8:44     ` Christian Brauner
2022-02-23 12:24       ` Trond Myklebust
2022-02-23 16:09         ` Christian Brauner
2022-02-24  8:52           ` Christian Brauner
2022-02-24  9:06             ` Su Yue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OS3PR01MB770539462BE3E7959DAF8B5789389@OS3PR01MB7705.jpnprd01.prod.outlook.com \
    --to=suy.fnst@fujitsu.com \
    --cc=christian.brauner@ubuntu.com \
    --cc=l@damenly.su \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).