[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250715002143.4033-1-hdanton@sina.com>
Date: Tue, 15 Jul 2025 08:21:39 +0800
From: Hillf Danton <hdanton@...a.com>
To: syzbot <syzbot+d4316c39e84f412115c9@...kaller.appspotmail.com>
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [fs?] WARNING: bad unlock balance in query_matching_vma
> Date: Mon, 14 Jul 2025 14:11:36 -0700
> syzbot found the following issue on:
>
> HEAD commit: a62b7a37e6fc Add linux-next specific files for 20250711
> git tree: linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=1422dd82580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=7d42120e19faaef
> dashboard link: https://syzkaller.appspot.com/bug?extid=d4316c39e84f412115c9
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1222dd82580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1205d0f0580000
#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;
--
Powered by blists - more mailing lists