From: Hillf Danton <hdanton@sina.com>
To: Boqun Feng <boqun.feng@gmail.com>
Cc: Suren Baghdasaryan <surenb@google.com>,
syzbot <syzbot+11701838dd42428ab7b3@syzkaller.appspotmail.com>,
Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
edumazet@google.com, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [net?] possible deadlock in vm_insert_page
Date: Sat, 28 Dec 2024 19:01:51 +0800 [thread overview]
Message-ID: <20241228110207.593-1-hdanton@sina.com> (raw)
In-Reply-To: <Z2_KXFdi5mSZ9kLa@boqun-archlinux>
On Sat, 28 Dec 2024 01:52:28 -0800 Boqun Feng <boqun.feng@gmail.com>
> On Fri, Dec 27, 2024 at 06:03:45PM -0800, Suren Baghdasaryan wrote:
> > On Fri, Dec 27, 2024 at 4:19 PM Hillf Danton <hdanton@sina.com> wrote:
> > > On Fri, 27 Dec 2024 04:59:22 -0800
> > > >
> > > > CPU0 CPU1
> > > > ---- ----
> > > > lock(&po->pg_vec_lock);
> > > > lock(&mm->mmap_lock);
> > > > lock(&po->pg_vec_lock);
> > > > lock(&vma->vm_lock->lock);
> > > >
> > > > *** DEADLOCK ***
> > > >
> > > > 2 locks held by syz.8.396/8273:
> > > > #0: ffff0000d6a2cc10 (&mm->mmap_lock){++++}-{4:4}, at: mmap_write_lock_killable include/linux/mmap_lock.h:122 [inline]
> > > > #0: ffff0000d6a2cc10 (&mm->mmap_lock){++++}-{4:4}, at: vm_mmap_pgoff+0x154/0x38c mm/util.c:578
> > > > #1: ffff0000d4aa2868 (&po->pg_vec_lock){+.+.}-{4:4}, at: packet_mmap+0x9c/0x4c8 net/packet/af_packet.c:4650
> > > >
> > > Given &mm->mmap_lock and &po->pg_vec_lock in same locking order on both sides,
> > > this deadlock report is bogus. Due to lockdep glitch?
>
> What do you mean by "both sides"? Note that, here is the report saying
CPU0/1 in the lockdep diagram above.
> the locks that are already held by the current task, and that current
> task is going to acquire &vma->vm_lock->lock, so lockdep finds new
> dependency:
Note the current task acquires &po->pg_vec_lock after taking &mm->mmap_lock,
and it is the &mm->mmap_lock (ignored by lockdep?) that makes the report
look bogus.
>
> &po->pg_vec_lock --> &vma->vm_lock->lock
>
> and there will be a circular dependency because (see above) lockdep
> recorded a dependency chain that:
>
> &vma->vm_lock->lock --> ... --> &po->pg_vec_lock
next prev parent reply other threads:[~2024-12-28 11:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-27 12:59 [syzbot] [net?] possible deadlock in vm_insert_page syzbot
2024-12-28 0:19 ` Hillf Danton
2024-12-28 2:03 ` Suren Baghdasaryan
2024-12-28 9:52 ` Boqun Feng
2024-12-28 11:01 ` Hillf Danton [this message]
2024-12-30 17:21 ` Suren Baghdasaryan
2024-12-30 18:04 ` Boqun Feng
2024-12-30 18:22 ` Suren Baghdasaryan
2024-12-30 18:31 ` Boqun Feng
2024-12-30 18:23 ` Boqun Feng
2024-12-30 18:49 ` Suren Baghdasaryan
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=20241228110207.593-1-hdanton@sina.com \
--to=hdanton@sina.com \
--cc=boqun.feng@gmail.com \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=surenb@google.com \
--cc=syzbot+11701838dd42428ab7b3@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.