Re: [PATCH] userfaultfd: fix deadlock warning when locking src and dst VMAs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 21 Mar 2024 16:58:18 -0700 Lokesh Gidra <lokeshgidra@xxxxxxxxxx> wrote:

> Use down_read_nested() to avoid the warning.
> 
> --- a/mm/userfaultfd.c
> +++ b/mm/userfaultfd.c
> @@ -1444,7 +1444,8 @@ static int uffd_move_lock(struct mm_struct *mm,
>  		 */
>  		down_read(&(*dst_vmap)->vm_lock->lock);
>  		if (*dst_vmap != *src_vmap)
> -			down_read(&(*src_vmap)->vm_lock->lock);
> +			down_read_nested(&(*src_vmap)->vm_lock->lock,
> +					 SINGLE_DEPTH_NESTING);
>  	}
>  	mmap_read_unlock(mm);
>  	return err;

Thanks, I added 

Fixes: 867a43a34ff8a ("userfaultfd: use per-vma locks in userfaultfd operations")





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux