From bb9fc8a8fe9560f329f72893a83a15093b7a08be Mon Sep 17 00:00:00 2001 From: Daeho Jeong Date: Mon, 21 Jan 2019 20:54:44 +0800 Subject: [PATCH] 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: Daeho Jeong Tested-by: Youngjin Gil Acked-by: Eric Dumazet Fixes: 8a81252b774b ("fs/file.c: don't acquire files->file_lock in fd_install()") Signed-off-by: Yang Yingliang Reviewed-by: Wei Fang --- fs/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/file.c b/fs/file.c index 7ffd6e9d103d..780d29e58847 100644 --- a/fs/file.c +++ b/fs/file.c @@ -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) -- GitLab