From: "David Hildenbrand (arm)" <david@kernel.org>
To: 是参差 <shicenci@gmail.com>, "linux-mm@kvack.org" <linux-mm@kvack.org>
Cc: "linmiaohe@huawei.com" <linmiaohe@huawei.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Zi Yan <ziy@nvidia.com>, Matthew Wilcox <willy@infradead.org>
Subject: Re: WARNING in memory_failure() at include/linux/huge_mm.h:635 triggered
Date: Wed, 4 Feb 2026 18:15:38 +0100 [thread overview]
Message-ID: <1db245a8-f9ab-42e4-8cc6-cc7562961921@kernel.org> (raw)
In-Reply-To: <b9e89c85-807c-4a8b-aa5c-8c1325e75445@kernel.org>
On 2/4/26 18:12, David Hildenbrand (arm) wrote:
> On 2/4/26 13:49, 是参差 wrote:
>> Hi,
>> I’m reporting a reproducible WARNING triggered in the hwpoison /
>> memory_failure path when injecting a hardware-poison event via
>> madvise(MADV_HWPOISON).
>>
>> The warning is triggered by a syzkaller C reproducer that:
>> maps a file-backed region with MAP_FIXED, touches related VMAs, and then
>> calls madvise() with MADV_HWPOISON over a large range.
>> The kernel reports a VM_WARN_ON_ONCE_FOLIO(1) from
>> memory_failure() and points to include/linux/huge_mm.h:635, suggesting
>> an unexpected folio/page state encountered while handling a poisoned
>> compound/huge folio.
>>
>> The target page appears to be a compound head page (order:3) already
>> marked hwpoison. memory_failure() seems to reach a branch that
>> unconditionally warns (VM_WARN_ON_ONCE_FOLIO(1) at include/linux/
>> huge_mm.h:635), which usually indicates an “unreachable”/unexpected
>> folio type or state transition in the huge/compound folio handling
>> logic during hwpoison processing.
>>
>> This looks like a kernel-side invariant violation rather than a pure
>> userspace misuse, since the warning is emitted from an unconditional
>> VM_WARN_ON_ONCE_FOLIO(1) site.
>>
>> Reproducer:
>> C reproducer: https://pastebin.com/raw/UxennX2B
>> console output: https://pastebin.com/raw/wrhKRwZY
>> kernel config: https://pastebin.com/raw/dP93yBLn
>>
>> Kernel:
>>
>> HEAD commit: 63804fed149a6750ffd28610c5c1c98cce6bd377
>>
>> git tree: torvalds/linux
>>
>> kernel version: 6.19.0-rc7 (QEMU Ubuntu 24.10)
>
> @Zi Yan, this is weird.
>
> We run into the VM_WARN_ON_ONCE_FOLIO(1, folio); in min_order_for_split(),
> which is only active with !CONFIG_TRANSPARENT_HUGEPAGE.
>
> But how do we get a large folio in that case? folio_test_large(folio)
> succeeded.
>
> I think we rules out hugetlb before in that function.
>
>
> Looking into the full console output, this is an order-3 folio (fully
> mapped).
>
> How do we end up with a large folio here? I am only aware of that
> happening when something would
> allocate an order-3 compound page (not a folio) and map it into the page
> tables. Yes, that
> is nasty and can still happen, not sure yet though whether that is
> really what the reproducer
> triggers.
Looking again,
mapping:0000000000000000 index:0xffff88800fe2e600
At least mapping==0 could indicate a non-folio thing.
--
Cheers,
David
next prev parent reply other threads:[~2026-02-04 17:15 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-04 12:49 是参差
2026-02-04 17:12 ` David Hildenbrand (arm)
2026-02-04 17:15 ` David Hildenbrand (arm) [this message]
2026-02-04 17:23 ` Zi Yan
2026-02-04 17:34 ` Zi Yan
2026-02-04 17:41 ` Zi Yan
2026-02-04 19:18 ` David Hildenbrand (arm)
2026-02-04 19:48 ` Zi Yan
2026-02-04 19:55 ` David Hildenbrand (arm)
2026-02-04 20:13 ` Zi Yan
2026-02-04 20:31 ` David Hildenbrand (arm)
2026-02-04 20:45 ` Zi Yan
2026-02-04 21:14 ` David Hildenbrand (arm)
2026-02-04 21:08 ` Zi Yan
2026-02-04 21:37 ` David Hildenbrand (arm)
2026-02-04 21:41 ` Zi Yan
2026-02-05 2:00 ` jane.chu
2026-02-05 3:21 ` Miaohe Lin
2026-02-05 3:53 ` Zi Yan
2026-02-05 7:18 ` Miaohe Lin
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=1db245a8-f9ab-42e4-8cc6-cc7562961921@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shicenci@gmail.com \
--cc=willy@infradead.org \
--cc=ziy@nvidia.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