[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250711022558.3290-1-hdanton@sina.com>
Date: Fri, 11 Jul 2025 10:25:57 +0800
From: Hillf Danton <hdanton@...a.com>
To: syzbot <syzbot+80011ad33eec39e6ce42@...kaller.appspotmail.com>
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [mm?] WARNING: lock held when returning to user space in lock_next_vma
> Date: Tue, 08 Jul 2025 10:52:27 -0700 [thread overview]
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 26ffb3d6f02c Add linux-next specific files for 20250704
> git tree: linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=1719df70580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=1e4f88512ae53408
> dashboard link: https://syzkaller.appspot.com/bug?extid=80011ad33eec39e6ce42
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1124abd4580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1099df70580000
#syz test
--- x/fs/proc/task_mmu.c
+++ y/fs/proc/task_mmu.c
@@ -586,6 +586,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;
@@ -630,6 +631,7 @@ static int do_procmap_query(struct proc_
return -ENOMEM;
}
+ mutex_lock(&query_mutex);
err = query_vma_setup(priv);
if (err)
goto fail_vma_setup;
@@ -712,6 +714,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),
@@ -733,6 +736,7 @@ static int do_procmap_query(struct proc_
out:
query_vma_teardown(priv);
fail_vma_setup:
+ mutex_unlock(&query_mutex);
mmput(mm);
kfree(name_buf);
return err;
--
Powered by blists - more mailing lists