Skip to content

Commit e31f0a5

Browse files
author
Al Viro
committed
procfs: make freeing proc_fs_info rcu-delayed
makes proc_pid_ns() safe from rcu pathwalk (put_pid_ns() is still synchronous, but that's not a problem - it does rcu-delay everything that needs to be) Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 4745880 commit e31f0a5

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

fs/proc/root.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ static void proc_kill_sb(struct super_block *sb)
271271

272272
kill_anon_super(sb);
273273
put_pid_ns(fs_info->pid_ns);
274-
kfree(fs_info);
274+
kfree_rcu(fs_info, rcu);
275275
}
276276

277277
static struct file_system_type proc_fs_type = {

include/linux/proc_fs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ struct proc_fs_info {
6565
kgid_t pid_gid;
6666
enum proc_hidepid hide_pid;
6767
enum proc_pidonly pidonly;
68+
struct rcu_head rcu;
6869
};
6970

7071
static inline struct proc_fs_info *proc_sb_info(struct super_block *sb)

0 commit comments

Comments
 (0)