From: Pedro Falcato <pfalcato@suse.de>
To: syzbot <syzbot+709f5ab0e03871dec50a@syzkaller.appspotmail.com>
Cc: Liam.Howlett@oracle.com, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
lorenzo.stoakes@oracle.com, shakeel.butt@linux.dev,
surenb@google.com, syzkaller-bugs@googlegroups.com,
vbabka@suse.cz, netdev@vger.kernel.org,
Josef Bacik <josef@toxicpanda.com>,
linux-block@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
Kuniyuki Iwashima <kuniyu@google.com>,
Jakub Kicinski <kuba@kernel.org>
Subject: Re: [syzbot] [mm?] possible deadlock in lock_mm_and_find_vma (4)
Date: Thu, 26 Feb 2026 18:04:07 +0000 [thread overview]
Message-ID: <btgotj7xgnzgoqwkfwk3pviof4cd6dnhxes3g32ncxz5ogcslk@epki2rug5yor> (raw)
In-Reply-To: <ibhdm4y3cwmornxfyxckosbznmtx3hi37tdp4xvha7a7wyaktp@rkrjyxdqmgb2>
On Thu, Feb 26, 2026 at 05:40:26PM +0000, Pedro Falcato wrote:
> +Cc netdev, block, nbd people
>
> On Thu, Feb 26, 2026 at 06:54:27AM -0800, syzbot wrote:
> <snip>
> >
> > Chain exists of:
> > fs_reclaim --> k-sk_lock-AF_INET6 --> &mm->mmap_lock
> >
> > Possible unsafe locking scenario:
> >
> > CPU0 CPU1
> > ---- ----
> > rlock(&mm->mmap_lock);
> > lock(k-sk_lock-AF_INET6);
> > lock(&mm->mmap_lock);
> > lock(fs_reclaim);
> >
> > *** DEADLOCK ***
> >
> > 2 locks held by syz.3.3387/17804:
> > #0: ffffffff905e2228 (br_ioctl_mutex){+.+.}-{4:4}, at: br_ioctl_call+0x34/0xa0 net/socket.c:1225
> > #1: ffff88807ad4b440 (&mm->mmap_lock){++++}-{4:4}, at: mmap_read_trylock include/linux/mmap_lock.h:611 [inline]
> > #1: ffff88807ad4b440 (&mm->mmap_lock){++++}-{4:4}, at: get_mmap_lock_carefully mm/mmap_lock.c:441 [inline]
> > #1: ffff88807ad4b440 (&mm->mmap_lock){++++}-{4:4}, at: lock_mm_and_find_vma+0x35/0x6f0 mm/mmap_lock.c:501
> >
>
> It looks to me like the issue is:
> setsockopt(nbd_sock) -> takes sk_lock -> copy_from_user -> page fault ->
> mmap_lock -> allocation needs reclaim -> fs_reclaim -> fs does IO -> nbd
> grabs sk_lock -> deadlock
>
Another funny case that came to me just now:
sendmsg(nbd_sock) -> lock_sock(nbd_sock) -> tcp_sendmsg_locked(nbd_sock) ->
copy_from_user() -> if VMA is backed by file on nbd bdev -> ... ->
lock_sock(nbd_sock)
Right? Is there something extremely crucial that I'm missing?
--
Pedro
prev parent reply other threads:[~2026-02-26 18:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 14:54 syzbot
2026-02-26 17:40 ` Pedro Falcato
2026-02-26 18:04 ` Pedro Falcato [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=btgotj7xgnzgoqwkfwk3pviof4cd6dnhxes3g32ncxz5ogcslk@epki2rug5yor \
--to=pfalcato@suse.de \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=edumazet@google.com \
--cc=josef@toxicpanda.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=netdev@vger.kernel.org \
--cc=shakeel.butt@linux.dev \
--cc=surenb@google.com \
--cc=syzbot+709f5ab0e03871dec50a@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=vbabka@suse.cz \
/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