From: Matthew Wilcox <willy@infradead.org>
To: syzbot <syzbot+069bb8b6fd64a600ab7b@syzkaller.appspotmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [fs?] WARNING in stable_page_flags
Date: Sat, 25 Jan 2025 14:20:18 +0000 [thread overview]
Message-ID: <Z5TzIj7A_DzT5688@casper.infradead.org> (raw)
In-Reply-To: <67944daf.050a0220.3ab881.000d.GAE@google.com>
On Fri, Jan 24, 2025 at 06:34:23PM -0800, syzbot wrote:
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 6789 at ./include/linux/mm.h:1228 folio_large_mapcount include/linux/mm.h:1228 [inline]
> WARNING: CPU: 0 PID: 6789 at ./include/linux/mm.h:1228 folio_mapcount include/linux/mm.h:1262 [inline]
> WARNING: CPU: 0 PID: 6789 at ./include/linux/mm.h:1228 folio_mapped include/linux/mm.h:1273 [inline]
> WARNING: CPU: 0 PID: 6789 at ./include/linux/mm.h:1228 page_mapped include/linux/mm.h:1283 [inline]
> WARNING: CPU: 0 PID: 6789 at ./include/linux/mm.h:1228 stable_page_flags+0xab5/0xbc0 fs/proc/page.c:132
I'm shocked we haven't seen this before.
kpageflags_read() iterates over every PFN in a range, calling
pfn_to_page() and then page_folio() on each of them. Since it makes
no attempt to establish a refcount on the folio (nor should it), the
page/folio can be freed under it. And that's what's happened; when it
first looked, this page was part of a slab, and now it's free.
What we need to do is memcpy() the page, just like we do in dump_page().
I'll get to it next week.
next prev parent reply other threads:[~2025-01-25 14:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-25 2:34 syzbot
2025-01-25 10:50 ` Hillf Danton
2025-01-25 14:20 ` Matthew Wilcox [this message]
2025-01-27 7:50 ` David Hildenbrand
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=Z5TzIj7A_DzT5688@casper.infradead.org \
--to=willy@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+069bb8b6fd64a600ab7b@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®