From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Hillf Danton <hdanton@sina.com>
Cc: syzbot <syzbot+159a3ef1894076a6a6e9@syzkaller.appspotmail.com>,
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [mm?] possible deadlock in lock_next_vma
Date: Tue, 15 Jul 2025 10:35:32 +0100 [thread overview]
Message-ID: <9634800d-6585-44c8-aa26-79055ee5c912@lucifer.local> (raw)
In-Reply-To: <20250715012717.4112-1-hdanton@sina.com>
Yup, aligns with my analysis, thanks!
I think it's just a case of parallel ioctl's not being taken into account
here.
On Tue, Jul 15, 2025 at 09:27:16AM +0800, Hillf Danton wrote:
> > Date: Mon, 14 Jul 2025 09:38:33 -0700 [thread overview]
> > syzbot has found a reproducer for the following issue on:
> >
> > HEAD commit: 0be23810e32e Add linux-next specific files for 20250714
> > git tree: linux-next
> > console output: https://syzkaller.appspot.com/x/log.txt?x=15cfb0f0580000
> > kernel config: https://syzkaller.appspot.com/x/.config?x=be9e2082003f81ff
> > dashboard link: https://syzkaller.appspot.com/bug?extid=159a3ef1894076a6a6e9
> > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1003b18c580000
> > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11437d82580000
>
> #syz test
>
> --- x/fs/proc/task_mmu.c
> +++ y/fs/proc/task_mmu.c
> @@ -585,6 +585,7 @@ no_vma:
> return ERR_PTR(-ENOENT);
> }
>
> +static DEFINE_MUTEX(query_mutex);
> static int do_procmap_query(struct proc_maps_private *priv, void __user *uarg)
> {
> struct procmap_query karg;
> @@ -620,8 +621,10 @@ static int do_procmap_query(struct proc_
> if (!mm || !mmget_not_zero(mm))
> return -ESRCH;
>
> + mutex_lock(&query_mutex);
> err = query_vma_setup(priv);
> if (err) {
> + mutex_unlock(&query_mutex);
> mmput(mm);
> return err;
> }
> @@ -712,6 +715,7 @@ static int do_procmap_query(struct proc_
>
> /* unlock vma or mmap_lock, and put mm_struct before copying data to user */
> query_vma_teardown(priv);
> + mutex_unlock(&query_mutex);
> mmput(mm);
>
> if (karg.vma_name_size && copy_to_user(u64_to_user_ptr(karg.vma_name_addr),
> @@ -732,6 +736,7 @@ static int do_procmap_query(struct proc_
>
> out:
> query_vma_teardown(priv);
> + mutex_unlock(&query_mutex);
> mmput(mm);
> kfree(name_buf);
> return err;
> --
next prev parent reply other threads:[~2025-07-15 9:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-12 5:57 syzbot
2025-07-14 16:38 ` syzbot
2025-07-15 1:27 ` Hillf Danton
2025-07-15 2:18 ` syzbot
2025-07-15 9:35 ` Lorenzo Stoakes [this message]
2025-07-17 2:34 ` Hillf Danton
2025-07-17 4:53 ` syzbot
2025-07-15 9:33 ` Lorenzo Stoakes
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=9634800d-6585-44c8-aa26-79055ee5c912@lucifer.local \
--to=lorenzo.stoakes@oracle.com \
--cc=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+159a3ef1894076a6a6e9@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®