提交 e8b205bf 编写于 作者: A Al Viro 提交者: Xie XiuQi

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

mainline inclusion
from mainline-5.2-rc1
commit ce285c26
category: bugfix
bugzilla: 14537
CVE: NA

---------------------------

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...
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Nzhengbin <zhengbin13@huawei.com>
Reviewed-by: Nzhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 627ada44
...@@ -69,6 +69,7 @@ struct autofs_info { ...@@ -69,6 +69,7 @@ struct autofs_info {
kuid_t uid; kuid_t uid;
kgid_t gid; kgid_t gid;
struct rcu_head rcu;
}; };
#define AUTOFS_INF_EXPIRING (1<<0) /* dentry in the process of expiring */ #define AUTOFS_INF_EXPIRING (1<<0) /* dentry in the process of expiring */
......
...@@ -36,7 +36,7 @@ void autofs_clean_ino(struct autofs_info *ino) ...@@ -36,7 +36,7 @@ void autofs_clean_ino(struct autofs_info *ino)
void autofs_free_ino(struct autofs_info *ino) void autofs_free_ino(struct autofs_info *ino)
{ {
kfree(ino); kfree_rcu(ino, rcu);
} }
void autofs_kill_sb(struct super_block *sb) void autofs_kill_sb(struct super_block *sb)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册