* [PATCH v4 04/10] fs: Add and export file_needs_remove_privs
[not found] <20230918150313.3845114-1-bschubert@ddn.com>
@ 2023-09-18 15:03 ` Bernd Schubert
0 siblings, 0 replies; only message in thread
From: Bernd Schubert @ 2023-09-18 15:03 UTC (permalink / raw)
To: linux-fsdevel
Cc: bernd.schubert, miklos, dsingh, Bernd Schubert, linux-btrfs,
Alexander Viro, Christian Brauner, Christoph Hellwig
Fuse cannot rely on S_NOSEC as local block device file systems.
In order to still being able to parallel direct IO writes,
it is going to use the new and exported function
file_needs_remove_privs() in an upcoming commit.
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Dharmendra Singh <dsingh@ddn.com>
Cc: linux-btrfs@vger.kernel.org
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
---
fs/inode.c | 8 ++++++++
include/linux/fs.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/fs/inode.c b/fs/inode.c
index 67611a360031..9b05db602e41 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -2013,6 +2013,14 @@ int dentry_needs_remove_privs(struct mnt_idmap *idmap,
return mask;
}
+int file_needs_remove_privs(struct file *file)
+{
+ struct dentry *dentry = file_dentry(file);
+
+ return dentry_needs_remove_privs(file_mnt_idmap(file), dentry);
+}
+EXPORT_SYMBOL_GPL(file_needs_remove_privs);
+
static int __remove_privs(struct mnt_idmap *idmap,
struct dentry *dentry, int kill)
{
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 562f2623c9c9..f7b45722bb6f 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2721,6 +2721,7 @@ extern struct inode *new_inode_pseudo(struct super_block *sb);
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 *);
+int file_needs_remove_privs(struct file *file);
extern int file_remove_privs(struct file *);
int setattr_should_drop_sgid(struct mnt_idmap *idmap,
const struct inode *inode);
--
2.39.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-09-18 16:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20230918150313.3845114-1-bschubert@ddn.com>
2023-09-18 15:03 ` [PATCH v4 04/10] fs: Add and export file_needs_remove_privs Bernd Schubert
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).