Commit 3836b31c authored by Christian Brauner's avatar Christian Brauner

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/20240806-work-procfs-v1-4-fb04e1d09f0c@kernel.orgReviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 32a0a965
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment