Skip to content

Commit

Permalink
procfs: make freeing proc_fs_info rcu-delayed
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Feb 25, 2024
1 parent 4745880 commit e31f0a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fs/proc/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ static void proc_kill_sb(struct super_block *sb)

kill_anon_super(sb);
put_pid_ns(fs_info->pid_ns);
kfree(fs_info);
kfree_rcu(fs_info, rcu);
}

static struct file_system_type proc_fs_type = {
Expand Down
1 change: 1 addition & 0 deletions include/linux/proc_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ struct proc_fs_info {
kgid_t pid_gid;
enum proc_hidepid hide_pid;
enum proc_pidonly pidonly;
struct rcu_head rcu;
};

static inline struct proc_fs_info *proc_sb_info(struct super_block *sb)
Expand Down

0 comments on commit e31f0a5

Please sign in to comment.