[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ce037c65-6eb3-6bce-0e79-4e483e090396@oracle.com>
Date: Tue, 8 Feb 2022 11:10:56 -0600
From: Mike Christie <michael.christie@...cle.com>
To: Jia-Ju Bai <baijiaju1990@...il.com>, njavali@...vell.com,
mrangankar@...vell.com, GR-QLogic-Storage-Upstream@...vell.com,
jejb@...ux.ibm.com, martin.petersen@...cle.com
Cc: linux-scsi@...r.kernel.org,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [BUG] scsi: qedi: possible ABBA deadlock in
qedi_process_tmf_resp() and qedi_process_cmd_cleanup_resp()
On 2/8/22 5:23 AM, Jia-Ju Bai wrote:
> 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 :)
>
That looks like a valid deadlock. I'll send a patch. Thanks.
> Reported-by: TOTE Robot <oslab@...nghua.edu.cn>
>
>
> Best wishes,
> Jia-Ju Bai
Powered by blists - more mailing lists