linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Lokesh Gidra <lokeshgidra@google.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	surenb@google.com, kernel-team@android.com, aarcange@redhat.com,
	peterx@redhat.com, david@redhat.com, axelrasmussen@google.com,
	bgeffon@google.com, jannh@google.com, kaleshsingh@google.com,
	ngeoffray@google.com, rppt@kernel.org, hdanton@sina.com,
	syzbot+49056626fe41e01f2ba7@syzkaller.appspotmail.com
Subject: Re: [PATCH] userfaultfd: fix deadlock warning when locking src and dst VMAs
Date: Thu, 21 Mar 2024 17:47:42 -0700	[thread overview]
Message-ID: <20240321174742.6c5622f4406673629e266db7@linux-foundation.org> (raw)
In-Reply-To: <20240321235818.125118-1-lokeshgidra@google.com>

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



      reply	other threads:[~2024-03-22  0:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 23:58 Lokesh Gidra
2024-03-22  0:47 ` Andrew Morton [this message]

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=20240321174742.6c5622f4406673629e266db7@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=aarcange@redhat.com \
    --cc=axelrasmussen@google.com \
    --cc=bgeffon@google.com \
    --cc=david@redhat.com \
    --cc=hdanton@sina.com \
    --cc=jannh@google.com \
    --cc=kaleshsingh@google.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lokeshgidra@google.com \
    --cc=ngeoffray@google.com \
    --cc=peterx@redhat.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=syzbot+49056626fe41e01f2ba7@syzkaller.appspotmail.com \
    /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