All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Leon Romanovsky <leon@kernel.org>
Cc: Doug Ledford <dledford@redhat.com>,
	Ariel Elior <ariel.elior@marvell.com>,
	linux-rdma@vger.kernel.org,
	Michal Kalderon <michal.kalderon@marvell.com>,
	Yishai Hadas <yishaih@mellanox.com>
Subject: Re: [PATCH rdma-rc] RDMA/uverbs: Fix a race with disassociate and exit_mmap()
Date: Wed, 22 Apr 2020 15:45:14 -0300	[thread overview]
Message-ID: <20200422184514.GB12730@ziepe.ca> (raw)
In-Reply-To: <20200413132136.930388-1-leon@kernel.org>

On Mon, Apr 13, 2020 at 04:21:36PM +0300, Leon Romanovsky wrote:
> From: Jason Gunthorpe <jgg@mellanox.com>
> 
> If uverbs_user_mmap_disassociate() is called while the mmap is
> concurrently doing exit_mmap then the ordering of the
> rdma_user_mmap_entry_put() is not reliable.
> 
> The put must be done before uvers_user_mmap_disassociate() returns,
> otherwise there can be a use after free on the ucontext, and a left over
> entry in the xarray. If the put is not done here then it is done during
> rdma_umap_close() later.
 
> Add the missing put to the error exit path.
> 
> Fixes: c043ff2cfb7f ("RDMA: Connect between the mmap entry and the umap_priv structure")
> Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
>  drivers/infiniband/core/uverbs_main.c | 4 ++++
>  1 file changed, 4 insertions(+)

Applied to for-next, thanks

Jason

      reply	other threads:[~2020-04-22 18:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-13 13:21 [PATCH rdma-rc] RDMA/uverbs: Fix a race with disassociate and exit_mmap() Leon Romanovsky
2020-04-22 18:45 ` Jason Gunthorpe [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=20200422184514.GB12730@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=ariel.elior@marvell.com \
    --cc=dledford@redhat.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=michal.kalderon@marvell.com \
    --cc=yishaih@mellanox.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.