History

autofs: fix use-after-free in lockless ->d_manage()

autofs_d_release() can overlap with lockless ->d_manage(), ending up with autofs_dentry_ino() freed under the latter. Make freeing autofs_info instances RCU-delayed...

Al Viro committed 7 years ago

Commit ce285c21 parent 5467a682 files · +2 −1Browse files

Unified · Split

2 files
  1. fs/autofs/autofs_i.h +1 −0
  2. fs/autofs/inode.c +1 −1
fs/autofs/autofs_i.h+1−0
@@ -71,6 +71,7 @@ struct autofs_info { · 70 unmodified lines
7171
7272 kuid_t uid;
7373 kgid_t gid;
74+ struct rcu_head rcu;
7475 };
7576
7677 #define AUTOFS_INF_EXPIRING (1<<0) /* dentry in the process of expiring */
fs/autofs/inode.c+1−1
@@ -36,7 +36,7 @@ void autofs_clean_ino(struct autofs_info *ino) · 35 unmodified lines
3636
3737 void autofs_free_ino(struct autofs_info *ino)
3838 {
39− kfree(ino);
39+ kfree_rcu(ino, rcu);
4040 }
4141
4242 void autofs_kill_sb(struct super_block *sb)