From patchwork Tue May 16 06:40:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daeho Jeong X-Patchwork-Id: 9728415 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 EE83760386 for ; Tue, 16 May 2017 06:50:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDDDC289F5 for ; Tue, 16 May 2017 06:50:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE73D289FA; Tue, 16 May 2017 06:50:35 +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 D8312289F5 for ; Tue, 16 May 2017 06:50:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750832AbdEPGud (ORCPT ); Tue, 16 May 2017 02:50:33 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:40593 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750791AbdEPGuc (ORCPT ); Tue, 16 May 2017 02:50:32 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OQ101K4V97J9520@mailout4.samsung.com> for linux-fsdevel@vger.kernel.org; Tue, 16 May 2017 15:40:31 +0900 (KST) Received: from epsmges1p2.samsung.com (unknown [182.195.40.92]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20170516064030epcas1p1194f4843eba1a6ef608c5c28c34ba0f9~-Au-wImzV2346923469epcas1p1T; Tue, 16 May 2017 06:40:30 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 71.E6.11213.EDE9A195; Tue, 16 May 2017 15:40:30 +0900 (KST) Received: from epsmgms2p1.samsung.com (unknown [182.195.42.79]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20170516064030epcas1p238af57ce4223442c821948621897d780~-Au-fipar1643616436epcas1p2R; Tue, 16 May 2017 06:40:30 +0000 (GMT) X-AuditID: b6c32a36-f79446d000002bcd-2f-591a9ede8c3f Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1.samsung.com (Symantec Messaging Gateway) with SMTP id D3.3E.02179.EDE9A195; Tue, 16 May 2017 15:40:30 +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 <0OQ1000UC97D5Y30@mmp2.samsung.com>; Tue, 16 May 2017 15:40:30 +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: Tue, 16 May 2017 15:40:32 +0900 Message-id: <1494916832-9732-1-git-send-email-daeho.jeong@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOKsWRmVeSWpSXmKPExsWy7bCmru69eVKRBmfv6Vjs+bSOzeLpsUfs Fnv2nmSx6Hh2mtHi/N/jrA6sHgs2lXq833eVzaNvyypGj8+b5Dw2PXnLFMAalWqTkZqYklqk kJqXnJ+SmZduq+QdHO8cb2pmYKhraGlhrqSQl5ibaqvk4hOg65aZA7RbSaEsMacUKBSQWFys pG9nU5RfWpKqkJF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0oMev2cUYI5yejxJTW PkaQKjYBbYnpy2exg9giAikSx143MIPYzAKaEpt/NLGA2MICzhKP1jxmArFZBFQldjW2Adkc HLwCbhINRw0glslJnDw2mXUCI/cCRoZVjFypBcW56bnFRgWGmxiBAbftsJb/DsYfZ6MPMQpw MCrx8F4Qk4oUYk0sK67MPcQowcGsJMJbZwIU4k1JrKxKLcqPLyrNSS0+xGgKtHEis5Rocj4w GvJK4g1NLI1MDMzMDI0MjM2UxHknBH6JEBJITyxJzU5NLUgtgulj4uCUamBcvVX0n+VaY3Xd Xj/x7cfb3mpHPrY/kTq5pN9nRRETl8LOC3uEzx2f3WVTvlvqsHnjzrSDjlZrM7K616wzyreT Vjj3Ym9R9oHGrZvFzAVmm1y9GbYm4H6Q4zPLuX6bxc54iK7KnTlfR6GKf/fFbau/83bcDVTY vqzsQG6pzcJT2eVS9pV8UfJKLMUZiYZazEXFiQCMn6u+TgIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170516064030epcas1p238af57ce4223442c821948621897d780 X-Msg-Generator: CA X-Sender-IP: 182.195.42.79 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: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-HopCount: 7 X-CMS-RootMailID: 20170516064030epcas1p238af57ce4223442c821948621897d780 X-RootMTR: 20170516064030epcas1p238af57ce4223442c821948621897d780 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 Acked-by: Eric Dumazet  --- 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)