All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Xu <xuyang2018.jy@fujitsu.com>
To: <linux-fsdevel@vger.kernel.org>, <ceph-devel@vger.kernel.org>
Cc: <viro@zeniv.linux.org.uk>, <david@fromorbit.com>,
	<djwong@kernel.org>, <brauner@kernel.org>, <willy@infradead.org>,
	<jlayton@kernel.org>, <xuyang2018.jy@fujitsu.com>,
	<pvorel@suse.cz>
Subject: [PATCH v10 4/4] ceph: rely on vfs for setgid stripping
Date: Thu, 14 Jul 2022 14:11:28 +0800	[thread overview]
Message-ID: <1657779088-2242-4-git-send-email-xuyang2018.jy@fujitsu.com> (raw)
In-Reply-To: <1657779088-2242-1-git-send-email-xuyang2018.jy@fujitsu.com>

Now that we finished moving setgid stripping for regular files in setgid
directories into the vfs, individual filesystem don't need to manually
strip the setgid bit anymore. Drop the now unneeded code from ceph.

Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Christian Brauner (Microsoft)<brauner@kernel.org>
Reviewed-and-Tested-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 fs/ceph/file.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index da59e836a06e..5a0266ea66ff 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -657,10 +657,6 @@ static int ceph_finish_async_create(struct inode *dir, struct dentry *dentry,
 		/* Directories always inherit the setgid bit. */
 		if (S_ISDIR(mode))
 			mode |= S_ISGID;
-		else if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP) &&
-			 !in_group_p(dir->i_gid) &&
-			 !capable_wrt_inode_uidgid(&init_user_ns, dir, CAP_FSETID))
-			mode &= ~S_ISGID;
 	} else {
 		in.gid = cpu_to_le32(from_kgid(&init_user_ns, current_fsgid()));
 	}
-- 
2.27.0


  parent reply	other threads:[~2022-07-14  5:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14  6:11 [PATCH v10 1/4] fs: add mode_strip_sgid() helper Yang Xu
2022-07-14  6:11 ` [PATCH v10 2/4] fs: Add missing umask strip in vfs_tmpfile Yang Xu
2022-07-14  6:11 ` [PATCH v10 3/4] fs: move S_ISGID stripping into the vfs_*() helpers Yang Xu
2022-07-14  6:11 ` Yang Xu [this message]
2022-07-14 12:56 ` [PATCH v10 1/4] fs: add mode_strip_sgid() helper Christian Brauner
2022-07-21 10:20   ` Christian Brauner

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=1657779088-2242-4-git-send-email-xuyang2018.jy@fujitsu.com \
    --to=xuyang2018.jy@fujitsu.com \
    --cc=brauner@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=pvorel@suse.cz \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.