Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752126AbdLMEmL (ORCPT ); Tue, 12 Dec 2017 23:42:11 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:40758 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750749AbdLMEmI (ORCPT ); Tue, 12 Dec 2017 23:42:08 -0500 Subject: Re: [BUG] scsi/qla2xxx: a possible sleep-in-atomic bug in qlt_get_tag From: James Bottomley To: Jia-Ju Bai , qla2xxx-upstream@qlogic.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, Linux Kernel Mailing List Date: Tue, 12 Dec 2017 20:42:01 -0800 In-Reply-To: <0363371c-db1c-169f-df5f-ca15b3839e41@gmail.com> References: <0363371c-db1c-169f-df5f-ca15b3839e41@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 17121304-0024-0000-0000-000017A522C8 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008196; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000244; SDB=6.00959446; UDB=6.00485229; IPR=6.00739468; BA=6.00005739; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00018514; XFM=3.00000015; UTC=2017-12-13 04:42:05 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17121304-0025-0000-0000-00004DE09332 Message-Id: <1513140121.3110.78.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-13_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1712130064 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1312 Lines: 35 On Wed, 2017-12-13 at 11:18 +0800, Jia-Ju Bai wrote: > The driver may sleep under a spinlock. > The function call paths are: > qlt_handle_abts_recv_work (acquire the spinlock) >    qlt_response_pkt_all_vps >      qlt_response_pkt >        qlt_handle_cmd_for_atio >          qlt_get_tag >            percpu_ida_alloc --> may sleep > > qla82xx_msix_rsp_q (acquire the spinlock) >    qla24xx_process_response_queue >      qlt_handle_abts_recv >        qlt_response_pkt_all_vps >          qlt_response_pkt >            qlt_handle_cmd_for_atio >              qlt_get_tag >                percpu_ida_alloc --> may sleep-in-atomic > > qla24xx_intr_handler (acquire the spinlock) >    qla24xx_process_response_queue >      qlt_handle_abts_recv >        qlt_response_pkt >          qlt_handle_cmd_for_atio >            qlt_get_tag >              percpu_ida_alloc --> 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 > checked by my code review. The report is incorrect: percpu_ida_alloc with state==TASK_RUNNING is atomic (and interrupt) safe which appears to be the case here. James