From: Jason Gunthorpe <jgg@mellanox.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: Stable tree <stable@vger.kernel.org>,
Greg KH <gregkh@linuxfoundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>,
Andrea Arcangeli <aarcange@redhat.com>,
Jann Horn <jannh@google.com>, Oleg Nesterov <oleg@redhat.com>,
Peter Xu <peterx@redhat.com>, Mike Rapoport <rppt@linux.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Joel Fernandes <joel@joelfernandes.org>
Subject: Re: [PATCH stable 4.4 v2] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping
Date: Mon, 10 Jun 2019 14:17:25 +0000 [thread overview]
Message-ID: <20190610141720.GB18446@mellanox.com> (raw)
In-Reply-To: <20190610135823.GI30967@dhcp22.suse.cz>
On Mon, Jun 10, 2019 at 03:58:23PM +0200, Michal Hocko wrote:
> Just a heads up. Ajay Kaher has noticed that mlx4 driver is missing the
> check in 4.14 [1] and 4.4 seems to have the same problem. I will wait
> for more review before reposting v3. The incremental diff is:
>
> diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
> index 67c4c73343d4..6968154a073e 100644
> +++ b/drivers/infiniband/hw/mlx4/main.c
> @@ -1042,6 +1042,8 @@ static void mlx4_ib_disassociate_ucontext(struct ib_ucontext *ibcontext)
> * mlx4_ib_vma_close().
> */
> down_write(&owning_mm->mmap_sem);
> + if (!mmget_still_valid(owning_mm))
> + goto skip_mm;
> for (i = 0; i < HW_BAR_COUNT; i++) {
> vma = context->hw_bar_info[i].vma;
> if (!vma)
> @@ -1061,6 +1063,7 @@ static void mlx4_ib_disassociate_ucontext(struct ib_ucontext *ibcontext)
> context->hw_bar_info[i].vma->vm_ops = NULL;
> }
>
> +skip_mm:
> up_write(&owning_mm->mmap_sem);
> mmput(owning_mm);
> put_task_struct(owning_process);
Looks OK to me
Jason
next prev parent reply other threads:[~2019-06-10 14:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-04 9:49 [RFC PATCH stable-4.4] " Michal Hocko
2019-06-10 7:46 ` [PATCH stable 4.4 v2] " Michal Hocko
2019-06-10 13:58 ` Michal Hocko
2019-06-10 14:17 ` Jason Gunthorpe [this message]
2019-06-17 6:58 ` [PATCH stable-4.4 v3] " Michal Hocko
2019-06-20 14:29 ` Greg KH
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=20190610141720.GB18446@mellanox.com \
--to=jgg@mellanox.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=jannh@google.com \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=oleg@redhat.com \
--cc=peterx@redhat.com \
--cc=rppt@linux.ibm.com \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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