Skip to content

Commit cf71eaa

Browse files
committed
proc: block mounting on top of /proc/<pid>/fdinfo/*
Entries under /proc/<pid>/fdinfo/* 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-6-fb04e1d09f0c@kernel.org Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 74ce208 commit cf71eaa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/proc/fd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,8 @@ static struct dentry *proc_fdinfo_instantiate(struct dentry *dentry,
397397
inode->i_fop = &proc_fdinfo_file_operations;
398398
tid_fd_update_inode(task, inode, 0);
399399

400-
d_set_d_op(dentry, &tid_fd_dentry_operations);
401-
return d_splice_alias(inode, dentry);
400+
return proc_splice_unmountable(inode, dentry,
401+
&tid_fd_dentry_operations);
402402
}
403403

404404
static struct dentry *

0 commit comments

Comments
 (0)