Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

Al Viro e31f0a57 47458802

+2 -1
+1 -1
fs/proc/root.c
··· 271 271 272 272 kill_anon_super(sb); 273 273 put_pid_ns(fs_info->pid_ns); 274 - kfree(fs_info); 274 + kfree_rcu(fs_info, rcu); 275 275 } 276 276 277 277 static struct file_system_type proc_fs_type = {
+1
include/linux/proc_fs.h
··· 65 65 kgid_t pid_gid; 66 66 enum proc_hidepid hide_pid; 67 67 enum proc_pidonly pidonly; 68 + struct rcu_head rcu; 68 69 }; 69 70 70 71 static inline struct proc_fs_info *proc_sb_info(struct super_block *sb)