提交 bb9fc8a8 编写于 作者: D Daeho Jeong 提交者: Xie XiuQi

fs: initialize resize_wait wait queue of init task

mainline inclusion
from next
commit: https://patchwork.kernel.org/patch/9785023/
category: bugfix
bugzilla: 5503
CVE: NA

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

We don't initialize resize_wait of init task now and all the kernel
threads share this uninitialized resize_wait wait queue because they
are sharing the file table of init task. Therefore, when expanding
this file table shared by the kernel threads, we encounter kernel panic
by accessing the NULL resize_wait wait queue.
Signed-off-by: NDaeho Jeong <daeho.jeong@samsung.com>
Tested-by: NYoungjin Gil <youngjin.gil@samsung.com>
Acked-by: NEric Dumazet <edumazet@google.com>
Fixes: 8a81252b ("fs/file.c: don't acquire files->file_lock in
fd_install()")
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NWei Fang <fangwei1@huawei.com>
上级 818d77c6
......@@ -457,6 +457,7 @@ struct files_struct init_files = {
.full_fds_bits = init_files.full_fds_bits_init,
},
.file_lock = __SPIN_LOCK_UNLOCKED(init_files.file_lock),
.resize_wait = __WAIT_QUEUE_HEAD_INITIALIZER(init_files.resize_wait),
};
static unsigned int find_next_fd(struct fdtable *fdt, unsigned int start)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册