From patchwork Fri May 20 16:10:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xu X-Patchwork-Id: 575437 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7712C433F5 for ; Fri, 20 May 2022 15:10:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350199AbiETPKy (ORCPT ); Fri, 20 May 2022 11:10:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350639AbiETPKw (ORCPT ); Fri, 20 May 2022 11:10:52 -0400 Received: from mail1.bemta34.messagelabs.com (mail1.bemta34.messagelabs.com [195.245.231.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBB6163A0; Fri, 20 May 2022 08:10:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fujitsu.com; s=170520fj; t=1653059446; i=@fujitsu.com; bh=AVZvvk8By7v5SnMkr9rpDYtWLxmKN2qhcVg7w2Ws7Pk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=h5mjKwiGdcrY1dSiefe34rZzXhdQ+9Sm38mtkRjdUTckAAgQw+5sEB6/tY7N9s+J3 UHQi7zCvT3C2kLScv8BHJHJvGUJgm5QzD6s2njXMCXswhJBYGD71jAZmLIaFrXFkKP 9tuvweKbNTVPje+qQx/jdjPyjHEwB/kOUYAWmTMNWisoVpatuY1m4w3327QbuFo1LL 6qMwuSq7Jd9AqzDlhQLhXFDFNpnVOQDmRiL5kDc+dvU0NzvYiu9OU/J/u9kWjOiF7s +nOhgsX/pf55PaQbRQ0GoFiz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Zqilid9hxNr/Cd9+hA3e53tItmytw/lUuyTc6ZXfTPQ8nferfZ0/xlN+R+/7hnYrS7cyev5/ eqNVtmZj1faL2c1i7hmvG/lVCWW4oxEQy3mouJEANr3H0GcAwAA X-Env-Sender: xuyang2018.jy@fujitsu.com X-Msg-Ref: server-9.tower-571.messagelabs.com!1653059445!68088!1 X-Originating-IP: [62.60.8.98] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.86.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6459 invoked from network); 20 May 2022 15:10:45 -0000 Received: from unknown (HELO n03ukasimr03.n03.fujitsu.local) (62.60.8.98) by server-9.tower-571.messagelabs.com with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 20 May 2022 15:10:45 -0000 Received: from n03ukasimr03.n03.fujitsu.local (localhost [127.0.0.1]) by n03ukasimr03.n03.fujitsu.local (Postfix) with ESMTP id 13A2AD75; Fri, 20 May 2022 16:10:45 +0100 (BST) Received: from R01UKEXCASM126.r01.fujitsu.local (unknown [10.183.43.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by n03ukasimr03.n03.fujitsu.local (Postfix) with ESMTPS id D635BB5C; Fri, 20 May 2022 16:10:44 +0100 (BST) Received: from localhost.localdomain (10.167.220.84) by R01UKEXCASM126.r01.fujitsu.local (10.183.43.178) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Fri, 20 May 2022 16:10:32 +0100 From: Yang Xu To: , CC: , , , , , , Yang Xu Subject: [PATCH v9 4/4] ceph: rely on vfs for setgid stripping Date: Sat, 21 May 2022 00:10:37 +0800 Message-ID: <1653063037-2461-4-git-send-email-xuyang2018.jy@fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1653063037-2461-1-git-send-email-xuyang2018.jy@fujitsu.com> References: <1653063037-2461-1-git-send-email-xuyang2018.jy@fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.220.84] X-ClientProxiedBy: G08CNEXCHPEKD08.g08.fujitsu.local (10.167.33.83) To R01UKEXCASM126.r01.fujitsu.local (10.183.43.178) X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org 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 Reviewed-by: Christian Brauner (Microsoft) Reviewed-and-Tested-by: Jeff Layton Signed-off-by: Yang Xu --- fs/ceph/file.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 8c8226c0feac..257ec53b1765 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())); }