aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Brauner <[email protected]>2024-08-06 18:02:30 +0200
committerChristian Brauner <[email protected]>2024-08-30 08:22:12 +0200
commit3836b31c3e717fcaa2b63c69e4bcf8ff7b82e6e4 (patch)
treee7c3f9780c5cf6e540b4fa2d1f57ed72f2b998ec
parent32a0a965b8a5b7b505babae2ee10c513ede376d8 (diff)
proc: block mounting on top of /proc/<pid>/map_files/*
Entries under /proc/<pid>/map_files/* are ephemeral and may go away before the process dies. As such allowing them to be used as mount points creates the ability to leak mounts that linger until the process dies with no ability to unmount them until then. Don't allow using them as mountpoints. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Josef Bacik <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
-rw-r--r--fs/proc/base.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 72a1acd03675..fce3d377b826 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2276,8 +2276,8 @@ proc_map_files_instantiate(struct dentry *dentry,
inode->i_op = &proc_map_files_link_inode_operations;
inode->i_size = 64;
- d_set_d_op(dentry, &tid_map_files_dentry_operations);
- return d_splice_alias(inode, dentry);
+ return proc_splice_unmountable(inode, dentry,
+ &tid_map_files_dentry_operations);
}
static struct dentry *proc_map_files_lookup(struct inode *dir,