public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: njavali@marvell.com, mrangankar@marvell.com,
	GR-QLogic-Storage-Upstream@marvell.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel <linux-kernel@vger.kernel.org>
Subject: [BUG] scsi: qedi: possible ABBA deadlock in qedi_process_tmf_resp() and qedi_process_cmd_cleanup_resp()
Date: Tue, 8 Feb 2022 19:23:01 +0800	[thread overview]
Message-ID: <e468fdcb-f47f-e01a-da65-68da79020165@gmail.com> (raw)

Hello,

My static analysis tool reports a possible ABBA deadlock in the qedi 
driver in Linux 5.16:

qedi_process_tmf_resp()
   spin_lock(&session->back_lock); --> Line 201 (Lock A)
   spin_lock(&qedi_conn->tmf_work_lock); --> Line 230 (Lock B)

qedi_process_cmd_cleanup_resp()
   spin_lock_bh(&qedi_conn->tmf_work_lock); --> Line 752 (Lock B)
   spin_lock_bh(&conn->session->back_lock); --> Line 784 (Lock A)

When qedi_process_tmf_resp() and qedi_process_cmd_cleanup_resp() are 
concurrently executed, the deadlock can occur.

I am not quite sure whether this possible deadlock is real and how to 
fix it if it is real.
Any feedback would be appreciated, thanks :)

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>


Best wishes,
Jia-Ju Bai

             reply	other threads:[~2022-02-08 11:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 11:23 Jia-Ju Bai [this message]
2022-02-08 17:10 ` [BUG] scsi: qedi: possible ABBA deadlock in qedi_process_tmf_resp() and qedi_process_cmd_cleanup_resp() Mike Christie

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=e468fdcb-f47f-e01a-da65-68da79020165@gmail.com \
    --to=baijiaju1990@gmail.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mrangankar@marvell.com \
    --cc=njavali@marvell.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