Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
userfaultfd_release: always remove uffd flags and clear vm_userfaultf…
…d_ctx 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. Link: http://lkml.kernel.org/r/[email protected] Fixes: 04f5866 ("coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping") Signed-off-by: Oleg Nesterov <[email protected]> Reported-by: Kefeng Wang <[email protected]> Reviewed-by: Andrea Arcangeli <[email protected]> Tested-by: Kefeng Wang <[email protected]> Cc: Peter Xu <[email protected]> Cc: Mike Rapoport <[email protected]> Cc: Jann Horn <[email protected]> Cc: Jason Gunthorpe <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Tetsuo Handa <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information