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 AE074C74A5B for ; Tue, 14 Mar 2023 13:12:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232006AbjCNNMt (ORCPT ); Tue, 14 Mar 2023 09:12:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230180AbjCNNMY (ORCPT ); Tue, 14 Mar 2023 09:12:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2EADA54E6; Tue, 14 Mar 2023 06:09:16 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id AEEEC6176E; Tue, 14 Mar 2023 13:08:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03D71C4339B; Tue, 14 Mar 2023 13:08:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678799320; bh=ED/H03msNnHIgXAuyVjvskK9upZlG+OK2TwrM9SGjfU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lzowUvaXPkJHagVv7IunguFP90CMIVrU+/qkLKhRqZxhm4Bp/hOJThUW2zrRZdh4L 38Kv0wLr1xUKWI0uGC4IYqqA1ysKSBB7nmYWySZmxBVnGHQmBoNxmTQuhoz0h4gTDs By+35VWKHvbDKogkg8HdKRIxdi96btucu/J+VB5BVfJVd4aCldITeyFkQHl8LfcC9M uFmrjN7pAJWhb/f83mtM98kvhf/HvAW0LJeiD9ozLQ49tQQh0qeYXQqXmzuPe1e/kB AMVK5cBiB1c23cPEFl1k32K0UzkNJAJlmQP4xuoVU+nudMhExTX2F4k64BjBmbu1co vJSGsjzWR+Oxw== Date: Tue, 14 Mar 2023 14:08:34 +0100 From: Christian Brauner To: Matthew Wilcox Cc: Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org Subject: Re: [PATCH v2] nfs: use vfs setgid helper Message-ID: <20230314130834.lf4lnebas3yfzspd@wittgenstein> References: <20230313-fs-nfs-setgid-v2-1-9a59f436cfc0@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, Mar 14, 2023 at 12:37:03PM +0000, Matthew Wilcox wrote: > On Tue, Mar 14, 2023 at 12:51:10PM +0100, Christian Brauner wrote: > > +++ b/include/linux/fs.h > > @@ -2675,6 +2675,8 @@ extern struct inode *new_inode(struct super_block *sb); > > extern void free_inode_nonrcu(struct inode *inode); > > extern int setattr_should_drop_suidgid(struct mnt_idmap *, struct inode *); > > extern int file_remove_privs(struct file *); > > +int setattr_should_drop_sgid(struct mnt_idmap *idmap, > > + const struct inode *inode); > > Is there a reason that setattr_should_drop_sgid() doesn't take a > const struct mnt_idmap pointer? Yeah, unfortunately a bunch of helpers that we're passing it down to from setattr_should_drop_sgid() currently take a non-const pointer to mnt_idmap. I have a ToDo that to go through all helpers and make them const wherever we can.