From: Jason Gunthorpe <jgg@mellanox.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Leon Romanovsky <leon@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-rdma@vger.kernel.org, Doug Ledford <dledford@redhat.com>
Subject: Re: [PATCH] infiniband: fix a subtle race condition
Date: Fri, 15 Jun 2018 13:08:33 -0600 [thread overview]
Message-ID: <20180615190833.GC5877@mellanox.com> (raw)
In-Reply-To: <CAM_iQpUYWzxMDgJJazLwvD1Tx_7i4PRC0r+2JKar3Vr4bW-Q+w@mail.gmail.com>
On Fri, Jun 15, 2018 at 10:57:49AM -0700, Cong Wang wrote:
> > No, it *is* the point - you've proposed a solution, one of many, and
> > we need to see an actual sensible design for how the locking around
> > ctx->file should work correctly.
>
> I proposed to a solution for imbalance unlock, you ask a design
> for use-after-free, which is *irrelevant*. So why it is the point?
The point is, I don't care about the imbalance report.
I care about the actual bug, which you have identified as
ucma_migrate_id() running concurrently with ucma_event_handler(). That
seems like a great analysis, BTW.
Stop that from happening and the lock imbalance warning will naturally go
away. So will the use after free.
I gave you some general ideas on how to do that, obviously they are
not easy to do eg somehow solving the dealock with mut would be
tricky. But maybe there is still some kind of simple solution..
Another option might be to just fail ucma_migrate_id() when
ucma_event_handler() is outstanding.. That *might* be OK.. We've
talked about doing things like this for other ucma syzkaller
bugs. Also a bit complicated.
Anyhow I'm NAK'ing this patch, since it just doesn't move things
forward, and removes a warning that is pointing at a bunch of
different bugs.
Jason
next prev parent reply other threads:[~2018-06-15 19:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-13 23:49 [PATCH] infiniband: fix a subtle race condition Cong Wang
2018-06-14 5:34 ` Leon Romanovsky
2018-06-14 6:21 ` Cong Wang
2018-06-14 7:01 ` Leon Romanovsky
2018-06-14 14:24 ` Jason Gunthorpe
2018-06-14 17:03 ` Cong Wang
2018-06-14 17:24 ` Jason Gunthorpe
2018-06-14 23:14 ` Cong Wang
2018-06-15 2:57 ` Jason Gunthorpe
2018-06-15 17:57 ` Cong Wang
2018-06-15 19:08 ` Jason Gunthorpe [this message]
2018-06-18 18:40 ` Cong Wang
2018-06-14 16:57 ` Cong Wang
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=20180615190833.GC5877@mellanox.com \
--to=jgg@mellanox.com \
--cc=dledford@redhat.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=xiyou.wangcong@gmail.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