All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: ccaulfie@redhat.com, teigland@redhat.com
Cc: cluster-devel@redhat.com, linux-kernel <linux-kernel@vger.kernel.org>
Subject: [BUG] fs: dlm: possible ABBA deadlock
Date: Thu, 19 Aug 2021 16:54:57 +0800	[thread overview]
Message-ID: <79f8d302-f53f-3891-965a-bcb460ab15ca@gmail.com> (raw)

Hello,

My static analysis tool reports a possible ABBA deadlock in the dlm 
filesystem in Linux 5.10:

dlm_recover_waiters_pre()
   mutex_lock(&ls->ls_waiters_mutex); --> line 5130
   recover_convert_waiter()
     _receive_convert_reply()
       lock_rsb()
         mutex_lock(&r->res_mutex); --> line 69

dlm_recover_waiters_post()
   lock_rsb()
     mutex_lock(&r->res_mutex); --> line 69
   mutex_lock(&ls->ls_waiters_mutex); --> line 5307

When dlm_recover_waiters_pre() and dlm_recover_waiters_post() 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

WARNING: multiple messages have this Message-ID (diff)
From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [BUG] fs: dlm: possible ABBA deadlock
Date: Thu, 19 Aug 2021 16:54:57 +0800	[thread overview]
Message-ID: <79f8d302-f53f-3891-965a-bcb460ab15ca@gmail.com> (raw)

Hello,

My static analysis tool reports a possible ABBA deadlock in the dlm 
filesystem in Linux 5.10:

dlm_recover_waiters_pre()
 ? mutex_lock(&ls->ls_waiters_mutex); --> line 5130
 ? recover_convert_waiter()
 ??? _receive_convert_reply()
 ????? lock_rsb()
 ??????? mutex_lock(&r->res_mutex); --> line 69

dlm_recover_waiters_post()
 ? lock_rsb()
 ??? mutex_lock(&r->res_mutex); --> line 69
 ? mutex_lock(&ls->ls_waiters_mutex); --> line 5307

When dlm_recover_waiters_pre() and dlm_recover_waiters_post() 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:[~2021-08-19  8:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19  8:54 Jia-Ju Bai [this message]
2021-08-19  8:54 ` [Cluster-devel] [BUG] fs: dlm: possible ABBA deadlock Jia-Ju Bai
2021-08-19 15:55 ` David Teigland
2021-08-19 15:55   ` [Cluster-devel] " David Teigland
2021-08-20  8:16   ` Jia-Ju Bai
2021-08-20  8:16     ` [Cluster-devel] " 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=79f8d302-f53f-3891-965a-bcb460ab15ca@gmail.com \
    --to=baijiaju1990@gmail.com \
    --cc=ccaulfie@redhat.com \
    --cc=cluster-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=teigland@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.