From patchwork Wed Jun 14 00:27:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daeho Jeong X-Patchwork-Id: 9785023 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 69486602DC for ; Wed, 14 Jun 2017 00:27:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 566672846F for ; Wed, 14 Jun 2017 00:27:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 484B32853B; Wed, 14 Jun 2017 00:27:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5366F2846F for ; Wed, 14 Jun 2017 00:27:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753311AbdFNA1W (ORCPT ); Tue, 13 Jun 2017 20:27:22 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:28691 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752129AbdFNA1W (ORCPT ); Tue, 13 Jun 2017 20:27:22 -0400 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20170614002720epoutp047d846618e51fc199994209fddae5d705~H1Wcz2n8G0320003200epoutp04D; Wed, 14 Jun 2017 00:27:20 +0000 (GMT) Received: from epsmges5p4.samsung.com (unknown [182.195.40.59]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20170614002719epcas1p34d99701e1202ad6bad30e7410d2cf450~H1WcXHLV20876308763epcas1p3F; Wed, 14 Jun 2017 00:27:19 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p4.samsung.com (EPCPMTA) with SMTP id 19.5D.01383.7E280495; Wed, 14 Jun 2017 09:27:19 +0900 (KST) Received: from epsmgms2p2.samsung.com (unknown [182.195.42.80]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20170614002719epcas5p3882aceef116f53781449010cc13f55e5~H1Wb9mit60322903229epcas5p3h; Wed, 14 Jun 2017 00:27:19 +0000 (GMT) X-AuditID: b6c32a58-f79896d000000567-0e-594082e715a3 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 18.07.02294.7E280495; Wed, 14 Jun 2017 09:27:19 +0900 (KST) Received: from localhost.localdomain ([10.253.100.138]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ORI00G9NH9GTI10@mmp2.samsung.com>; Wed, 14 Jun 2017 09:27:19 +0900 (KST) From: Daeho Jeong To: edumazet@google.com, mguzik@redhat.com, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org Cc: Daeho Jeong Subject: [PATCH] fs: initialize resize_wait wait queue of init task Date: Wed, 14 Jun 2017 09:27:21 +0900 Message-id: <1497400041-14501-1-git-send-email-daeho.jeong@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBKsWRmVeSWpSXmKPExsWy7bCmpu7zJodIg4nvjSz2fFrHZvH02CN2 iz17T7JYdDw7zWhx/u9xVgdWjwWbSj3e77vK5tG3ZRWjx+dNch6bnrxlCmCNSrXJSE1MSS1S SM1Lzk/JzEu3VfIOjneONzUzMNQ1tLQwV1LIS8xNtVVy8QnQdcvMAdqtpFCWmFMKFApILC5W 0rezKcovLUlVyMgvLrFVijY0NNI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zSjR2L2WFcH4ySmxs bAerYhPQlpi+fBZYt4hAisSx1w3MIDazgKbE5h9NLCC2sICzxKM1j5lAbBYBVYlpf5YD9XJw 8Aq4SzQ+VIBYJidx8thk1gmM3AsYGVYxcqUWFOem5xYbFRhtYgQG3LbDWgE7GJvORR9iFOBg VOLh7XhrHynEmlhWXJl7iFGCg1lJhFewzCFSiDclsbIqtSg/vqg0J7X4EKMp0MaJzFKiyfnA aMgriTc0sTQyMTAzMzQyMDZTEuedEPglQkggPbEkNTs1tSC1CKaPiYNTqoGxY1eKisyh+x8O Su4si9s18YTyGS7X+TUHyzjSztyfunfrFZfHPTqBbH+WG1aG6l64mHHix6oZS/ZK3ZFf9DOw RrmQ9/SruFjf1pKnc9bm/zyr/MHEY/t8O17JTeULVWU59q3ybpG8dlF6lX7vqfuq+l4OD46t mXrNXObATtmll+P+Gdoa63yWVWIpzkg01GIuKk4EANLlc3NOAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170614002719epcas5p3882aceef116f53781449010cc13f55e5 X-Msg-Generator: CA X-Sender-IP: 182.195.42.80 X-Local-Sender: =?UTF-8?B?7KCV64yA7Zi4G1N5c3RlbSBTL1fqsJzrsJwx6re466O5KA==?= =?UTF-8?B?66y07ISgKRvsgrzshLHsoITsnpAbU2VuaW9yIEVuZ2luZWVyL0V4cGVydCBQ?= =?UTF-8?B?cm9ncmFtbWVy?= X-Global-Sender: =?UTF-8?B?RGFlaG8gSmVvbmcbU3lzdGVtIFMvVyBSJkQgR3JvdXAgMRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG1RFTEUbQzEwRDkxMjE=?= CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20170614002719epcas5p3882aceef116f53781449010cc13f55e5 X-RootMTR: 20170614002719epcas5p3882aceef116f53781449010cc13f55e5 References: Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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()") --- fs/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/file.c b/fs/file.c index ad6f094f2eff..74748c32e07a 100644 --- a/fs/file.c +++ b/fs/file.c @@ -475,6 +475,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)