Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752361AbdLLBgW (ORCPT ); Mon, 11 Dec 2017 20:36:22 -0500 Received: from m12-16.163.com ([220.181.12.16]:44217 "EHLO m12-16.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbdLLBgV (ORCPT ); Mon, 11 Dec 2017 20:36:21 -0500 From: Jia-Ju Bai Subject: [BUG] drivers/tty/hvc: a possible sleep-in-atomic bug in xen_pv_console_init To: gregkh@linuxfoundation.org, jslaby@suse.com, benh@kernel.crashing.org Cc: linuxppc-dev@lists.ozlabs.org, Linux Kernel Mailing List Message-ID: <1e23a5cc-8dad-e7d5-ea2d-3acbc1f34c3e@163.com> Date: Tue, 12 Dec 2017 09:35:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-CM-TRANSID: EMCowAB3pCx+Mi9awyZJDQ--.52525S2 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjxUyGXdDUUUU X-Originating-IP: [166.111.70.3] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/1tbiTh+selUC1FuQVwAAsY Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 383 Lines: 14 According to drivers/tty/hvc/hvc_xen.c, the kernel module may sleep under a spinlock. The function call path is: xen_pv_console_init (acquire the spinlock) xencons_info_pv_init gfn_to_virt (gfn_to_pfn) --> may sleep I do not find a good way to fix it, so I only report. This possible bug is found by my static analysis tool (DSAC) and my code review. Thanks, Jia-Ju Bai