From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+8f9f411152c9539f4e59@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [xfs?] [mm?] WARNING: bad unlock balance in __mm_populate
Date: Wed, 5 Mar 2025 08:55:56 +0800 [thread overview]
Message-ID: <tencent_DBDF1933CFD60D9B25D30DB592655DEFDD07@qq.com> (raw)
In-Reply-To: <67c49230.050a0220.55417.04d5.GAE@google.com>
#syz test
diff --git a/mm/gup.c b/mm/gup.c
index 3883b307780e..66c28dea091f 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1434,6 +1434,7 @@ static long __get_user_pages(struct mm_struct *mm,
VM_BUG_ON(!!pages != !!(gup_flags & (FOLL_GET | FOLL_PIN)));
+ printk("mm: %p, map lock held: %d, locked: %d, %s\n", mm, lockdep_is_held(&mm->mmap_lock), *locked, __func__);
do {
struct page *page;
unsigned int page_increm;
@@ -1469,6 +1470,7 @@ static long __get_user_pages(struct mm_struct *mm,
if (!vma) {
ret = -EFAULT;
+ printk("mm1: %p, map held lock: %d, vma: %p, %s\n", mm, lockdep_is_held(&mm->mmap_lock), vma, __func__);
goto out;
}
ret = check_vma_flags(vma, gup_flags);
@@ -1484,7 +1486,9 @@ static long __get_user_pages(struct mm_struct *mm,
ret = -EINTR;
goto out;
}
+ printk("<before resched> mm: %p, map lock held: %d, %s\n", mm, lockdep_is_held(&mm->mmap_lock), __func__);
cond_resched();
+ printk("<after resched> mm: %p, map lock held: %d, %s\n", mm, lockdep_is_held(&mm->mmap_lock), __func__);
page = follow_page_mask(vma, start, gup_flags, &ctx);
if (!page || PTR_ERR(page) == -EMLINK) {
@@ -1500,6 +1504,7 @@ static long __get_user_pages(struct mm_struct *mm,
case -EFAULT:
case -ENOMEM:
case -EHWPOISON:
+ printk("mm2: %p, map held lock: %d, vma: %p, ret: %d, %s\n", mm, lockdep_is_held(&mm->mmap_lock), vma, ret, __func__);
goto out;
}
BUG();
@@ -1552,6 +1557,7 @@ static long __get_user_pages(struct mm_struct *mm,
*/
gup_put_folio(folio, 1, gup_flags);
ret = -EFAULT;
+ printk("mm3: %p, map held lock: %d, folio: %p, %s\n", mm, lockdep_is_held(&mm->mmap_lock), folio, __func__);
goto out;
}
}
@@ -2029,7 +2035,12 @@ int __mm_populate(unsigned long start, unsigned long len, int ignore_errors)
* double checks the vma flags, so that it won't mlock pages
* if the vma was already munlocked.
*/
+ printk("1mm: %p, vma: %p, mmap lock held: %d, locked: %d, vma is acc: %d, %s\n",
+ mm, vma, lockdep_is_held(&mm->mmap_lock), locked, vma_is_accessible(vma), __func__);
ret = populate_vma_page_range(vma, nstart, nend, &locked);
+ printk("mm: %p, vma: %p, mmap lock held: %d, locked: %d, ret: %ld, mm addr is valid: %d, %s\n",
+ mm, vma, lockdep_is_held(&mm->mmap_lock), locked, ret, virt_addr_valid((void*)mm), __func__);
+
if (ret < 0) {
if (ignore_errors) {
ret = 0;
next prev parent reply other threads:[~2025-03-05 0:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-02 17:15 syzbot
2025-03-04 1:38 ` Edward Adam Davis
2025-03-04 1:54 ` syzbot
2025-03-04 2:01 ` Edward Adam Davis
2025-03-04 2:22 ` syzbot
2025-03-04 12:25 ` Edward Adam Davis
2025-03-04 13:19 ` syzbot
2025-03-04 14:33 ` Edward Adam Davis
2025-03-04 15:09 ` syzbot
2025-03-05 0:55 ` Edward Adam Davis [this message]
2025-03-05 1:17 ` syzbot
2025-03-05 12:08 ` Edward Adam Davis
2025-03-05 12:39 ` syzbot
2025-03-05 13:45 ` Edward Adam Davis
2025-03-05 14:09 ` syzbot
2025-03-05 14:15 ` Edward Adam Davis
2025-03-05 15:22 ` syzbot
2025-03-06 12:52 ` Edward Adam Davis
2025-03-06 12:54 ` syzbot
2025-03-06 12:57 ` Edward Adam Davis
2025-03-06 13:24 ` syzbot
2025-03-09 3:30 ` Edward Adam Davis
2025-03-09 3:53 ` syzbot
2025-03-16 3:32 ` Edward Adam Davis
2025-03-16 4:29 ` syzbot
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=tencent_DBDF1933CFD60D9B25D30DB592655DEFDD07@qq.com \
--to=eadavis@qq.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+8f9f411152c9539f4e59@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®