From: syzbot <syzbot+35a4414f6e247f515443@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] Re: [syzbot] [kernel?] WARNING in follow_pte
Date: Wed, 03 Jul 2024 18:30:35 -0700 [thread overview]
Message-ID: <000000000000bcfc2e061c61e464@google.com> (raw)
In-Reply-To: <00000000000047cef3061c5be92d@google.com>
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: Re: [syzbot] [kernel?] WARNING in follow_pte
Author: lizhi.xu@windriver.com
Fixes: c5541ba378e3 ("mm: follow_pte() improvements")
It introduced mmap_assert_locked(mm) in follow_pte.
This case content does not hold mm lock.
#syz test: upstream 734610514cb0
diff --git a/arch/x86/mm/pat/memtype.c b/arch/x86/mm/pat/memtype.c
index bdc2a240c2aa..0f2cfe595686 100644
--- a/arch/x86/mm/pat/memtype.c
+++ b/arch/x86/mm/pat/memtype.c
@@ -954,8 +954,12 @@ static int follow_phys(struct vm_area_struct *vma, unsigned long *prot,
pte_t *ptep, pte;
spinlock_t *ptl;
- if (follow_pte(vma, vma->vm_start, &ptep, &ptl))
+ mmap_read_lock(vma->mm);
+ if (follow_pte(vma, vma->vm_start, &ptep, &ptl)) {
+ mmap_read_unlock(current->mm);
return -EINVAL;
+ }
+ mmap_read_unlock(vma->mm);
pte = ptep_get(ptep);
next prev parent reply other threads:[~2024-07-04 1:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-03 18:22 [syzbot] [kernel?] WARNING in follow_pte syzbot
2024-07-04 1:30 ` syzbot [this message]
2024-07-04 1:57 ` [syzbot] " syzbot
2024-07-04 2:48 ` syzbot
2024-07-11 4:12 ` [syzbot] " 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=000000000000bcfc2e061c61e464@google.com \
--to=syzbot+35a4414f6e247f515443@syzkaller.appspotmail.com \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.