[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190820160525.GN31518@redhat.com>
Date: Tue, 20 Aug 2019 12:05:25 -0400
From: Andrea Arcangeli <aarcange@...hat.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Kefeng Wang <wangkefeng.wang@...wei.com>,
linux-mm <linux-mm@...ck.org>, Peter Xu <peterx@...hat.com>,
Mike Rapoport <rppt@...ux.ibm.com>,
Jann Horn <jannh@...gle.com>,
Jason Gunthorpe <jgg@...lanox.com>,
Michal Hocko <mhocko@...e.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] userfaultfd_release: always remove uffd flags and clear
vm_userfaultfd_ctx
On Tue, Aug 20, 2019 at 06:02:38PM +0200, Oleg Nesterov wrote:
> userfaultfd_release() should clear vm_flags/vm_userfaultfd_ctx even
> if mm->core_state != NULL.
>
> Otherwise a page fault can see userfaultfd_missing() == T and use an
> already freed userfaultfd_ctx.
>
> Reported-by: Kefeng Wang <wangkefeng.wang@...wei.com>
> Fixes: 04f5866e41fb ("coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping")
> Cc: stable@...r.kernel.org
> Signed-off-by: Oleg Nesterov <oleg@...hat.com>
> ---
> fs/userfaultfd.c | 25 +++++++++++++------------
> 1 file changed, 13 insertions(+), 12 deletions(-)
Reviewed-by: Andrea Arcangeli <aarcange@...hat.com>
Thanks,
Andrea
Powered by blists - more mailing lists