On 5 Nov 2025, at 18:57, Andrew Morton wrote:
On Wed, 5 Nov 2025 11:29:10 -0500 Zi Yan ziy@nvidia.com wrote:
Both uniform and non uniform split check missed the check to prevent splitting anon folios in swapcache to non-zero order. Fix the check.
Please describe the possible userspace-visible effects of the bug especially when proposing a -stable backport.
Splitting anon folios in swapcache to non-zero order can cause data corruption since swapcache only support PMD order and order-0 entries. This can happen when one use split_huge_pages under debugfs to split anon folios in swapcache.
Fixes: 58729c04cf10 ("mm/huge_memory: add buddy allocator like (non-uniform) folio_split()") Reported-by: "David Hildenbrand (Red Hat)" david@kernel.org Closes: https://lore.kernel.org/all/dc0ecc2c-4089-484f-917f-920fdca4c898@kernel.org/
I was hopeful, but that's "from code inspection".
In-tree callers do not perform such an illegal operation. Only debugfs interface could trigger it. I will put adding a test case on my TODO list.
Cc: stable@vger.kernel.org Signed-off-by: Zi Yan ziy@nvidia.com
Best Regards, Yan, Zi