Skip to contentSkip to conversation

CVE-2026-99728: mm/huge_memory: fix list corruption when deferred_split_scan() races with deferred_split_folio()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Nov 20

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

mm/huge_memory: fix list corruption when deferred_split_scan() races with deferred_split_folio()

Since the deferred split queue became a list_lru, the isolate callback moves the folios it took a reference on to an on-stack list, linked through folio->_deferred_list, and deferred_split_scan() takes them off that list with list_del_init() without holding the list_lru lock.

deferred_split_folio() does not know about the on-stack list. It only holds the list_lru lock when it looks at the same list_head, and it can run for such a folio: a THP is queued when it is mapped, as a candidate for the underused check, and is queued "again" when a part of it gets unmapped:

CPU0 deferred_split_scan() CPU1 deferred_split_folio()
list_del_init(&folio->_deferred_list)

    next->prev = prev
    prev->next = next
    entry->next = entry
                                      list_lru_lock_irqsave()
                                      folio_set_partially_mapped()
                                      __list_lru_add()
                                        list_empty(item)  -> true
                                        list_add_tail(item, &l->list)
                                          item->next = &l->list
                                          item->prev = tail
    entry->prev = entry

The folio now sits on the list_lru with ->prev pointing to itself. The next removal leaves the neighbours pointing to it, and they still do so after the folio has been freed. With CONFIG_DEBUG_LIST:

list_del corruption. prev->next should be ffd4000000270090, but was ffd4000000278090. (prev=ffd4000000270090)

Fix it by grabbing the lock around list_del_init() so deferred_split_folio() cannot race with it.

The Linux kernel CVE team has assigned CVE-2026-99728 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 7.2 with commit fafaeceb89a5e2e856ff04c2cacb6cae4a2ecb67 and fixed in 7.3.5 with commit 877a9fbabf760714f510f36b310a986c4be2c2d8
	Issue introduced in 7.2 with commit fafaeceb89a5e2e856ff04c2cacb6cae4a2ecb67 and fixed in 7.4-rc2 with commit f09171b67ea06a7fe425db33e8b74a92de1426b9

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-99728

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
mm/huge_memory.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/877a9fbabf760714f510f36b310a986c4be2c2d8
	https://git.kernel.org/stable/c/f09171b67ea06a7fe425db33e8b74a92de1426b9