From: David Miller <davem@davemloft.net>
To: sowmini.varadhan@oracle.com
Cc: netdev@vger.kernel.org, rds-devel@oss.oracle.com,
santosh.shilimkar@oracle.com
Subject: Re: [PATCH net-next] rds: avoid lock hierarchy violation between m_rs_lock and rs_recv_lock
Date: Sat, 11 Aug 2018 11:22:25 -0700 (PDT) [thread overview]
Message-ID: <20180811.112225.71238093640629717.davem@davemloft.net> (raw)
In-Reply-To: <1533761833-106379-1-git-send-email-sowmini.varadhan@oracle.com>
From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Date: Wed, 8 Aug 2018 13:57:13 -0700
> The following deadlock, reported by syzbot, can occur if CPU0 is in
> rds_send_remove_from_sock() while CPU1 is in rds_clear_recv_queue()
>
> CPU0 CPU1
> ---- ----
> lock(&(&rm->m_rs_lock)->rlock);
> lock(&rs->rs_recv_lock);
> lock(&(&rm->m_rs_lock)->rlock);
> lock(&rs->rs_recv_lock);
>
> The deadlock should be avoided by moving the messages from the
> rs_recv_queue into a tmp_list in rds_clear_recv_queue() under
> the rs_recv_lock, and then dropping the refcnt on the messages
> in the tmp_list (potentially resulting in rds_message_purge())
> after dropping the rs_recv_lock.
>
> The same lock hierarchy violation also exists in rds_still_queued()
> and should be avoided in a similar manner
>
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
> Reported-by: syzbot+52140d69ac6dc6b927a9@syzkaller.appspotmail.com
I'm putting this in deferred state for now.
Sowmini, once you and Santosh agree on what exactly to do, please
resubmit.
Thank you.
prev parent reply other threads:[~2018-08-11 23:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-08 20:57 [PATCH net-next] rds: avoid lock hierarchy violation between m_rs_lock and rs_recv_lock Sowmini Varadhan
2018-08-08 21:51 ` Santosh Shilimkar
2018-08-08 22:18 ` Sowmini Varadhan
2018-08-08 22:37 ` Santosh Shilimkar
2018-08-11 18:22 ` David Miller [this message]
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=20180811.112225.71238093640629717.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=rds-devel@oss.oracle.com \
--cc=santosh.shilimkar@oracle.com \
--cc=sowmini.varadhan@oracle.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;
as well as URLs for NNTP newsgroup(s).