lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20240321174742.6c5622f4406673629e266db7@linux-foundation.org>
Date: Thu, 21 Mar 2024 17:47:42 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Lokesh Gidra <lokeshgidra@...gle.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org, surenb@...gle.com,
 kernel-team@...roid.com, aarcange@...hat.com, peterx@...hat.com,
 david@...hat.com, axelrasmussen@...gle.com, bgeffon@...gle.com,
 jannh@...gle.com, kaleshsingh@...gle.com, ngeoffray@...gle.com,
 rppt@...nel.org, hdanton@...a.com,
 syzbot+49056626fe41e01f2ba7@...kaller.appspotmail.com
Subject: Re: [PATCH] userfaultfd: fix deadlock warning when locking src and
 dst VMAs

On Thu, 21 Mar 2024 16:58:18 -0700 Lokesh Gidra <lokeshgidra@...gle.com> 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")


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ