public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: qla2xxx-upstream@qlogic.com, jejb@linux.vnet.ibm.com,
	martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [BUG] scsi/qla2xxx: a possible sleep-in-atomic bug in qlt_get_tag
Date: Wed, 13 Dec 2017 11:18:07 +0800	[thread overview]
Message-ID: <0363371c-db1c-169f-df5f-ca15b3839e41@gmail.com> (raw)

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.


Thanks,
Jia-Ju Bai

             reply	other threads:[~2017-12-13  3:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13  3:18 Jia-Ju Bai [this message]
2017-12-13  4:42 ` [BUG] scsi/qla2xxx: a possible sleep-in-atomic bug in qlt_get_tag James Bottomley
2017-12-13  7:38   ` Jia-Ju Bai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0363371c-db1c-169f-df5f-ca15b3839e41@gmail.com \
    --to=baijiaju1990@gmail.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=qla2xxx-upstream@qlogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox