CVE-2023-52490: mm: migrate: fix getting incorrect page mapping during page migration

Published Feb 29, 2024
·
Updated

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

mm: migrate: fix getting incorrect page mapping during page migration

The Linux kernel CVE team has assigned CVE-2023-52490 to this issue.

Upstream advisory: https://lore.kernel.org/linux-cve-announce/20240229155245.1571576-31-lee@kernel.org/T

Other sources

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

mm: migrate: fix getting incorrect page mapping during page migration

When running stress-ng testing, we found below kernel crash after a few hours:

Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 pc : dentryname+0xd8/0x224 lr : pointer+0x22c/0x370 sp : ffff800025f134c0 ...... Call trace: dentryname+0xd8/0x224 pointer+0x22c/0x370 vsnprintf+0x1ec/0x730 vscnprintf+0x2c/0x60 vprintkstore+0x70/0x234 vprintkemit+0xe0/0x24c vprintkdefault+0x3c/0x44 vprintkfunc+0x84/0x2d0 printk+0x64/0x88 dumppage+0x52c/0x530 dumppage+0x14/0x20 setmigratetypeisolate+0x110/0x224 startisolatepagerange+0xc4/0x20c offlinepages+0x124/0x474 memoryblockoffline+0x44/0xf4 memorysubsysoffline+0x3c/0x70 deviceoffline+0xf0/0x120 ......

After analyzing the vmcore, I found this issue is caused by page migration. The scenario is that, one thread is doing page migration, and we will use the target page's ->mapping field to save 'anonvma' pointer between page unmap and page move, and now the target page is locked and refcount is 1.

Currently, there is another stress-ng thread performing memory hotplug, attempting to offline the target page that is being migrated. It discovers that the refcount of this target page is 1, preventing the offline operation, thus proceeding to dump the page. However, pagemapping() of the target page may return an incorrect file mapping to crash the system in dumpmapping(), since the target page->mapping only saves 'anonvma' pointer without setting PAGEMAPPINGANON flag.

There are seveval ways to fix this issue: (1) Setting the PAGEMAPPINGANON flag for target page's ->mapping when saving 'anonvma', but this can confuse PageAnon() for PFN walkers, since the target page has not built mappings yet. (2) Getting the page lock to call pagemapping() in dumppage() to avoid crashing the system, however, there are still some PFN walkers that call pagemapping() without holding the page lock, such as compaction. (3) Using target page->private field to save the 'anonvma' pointer and 2 bits page state, just as page->mapping records an anonymous page, which can remove the pagemapping() impact for PFN walkers and also seems a simple way.

So I choose option 3 to fix this issue, and this can also fix other potential issues for PFN walkers, such as compaction.

— NVD

Affected Software

11 affected componentsFixes available
redhat/kernel<6.6.15
6.6.15
redhat/kernel<6.7.3
6.7.3
redhat/kernel<6.8
6.8
Linux Linux kernel>=6.3<6.6.15
Linux Linux kernel>=6.7<6.7.3
debian/linux<6.6.15-1
6.6.15-1
debian/linux<6.6.15-1
6.6.15-1
linux/kernel<6.1.191
6.1.191
linux/kernel>=6.2.0<6.6.15
6.6.15
linux/kernel>=6.3.0<6.7.3
6.7.3
debian/linux
6.1.176-16.1.190-16.12.107-16.12.115-27.2.12-17.2.15-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 6.6.15
  2. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 6.7.3
  3. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 6.8
  4. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.1.191
  5. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.6.15
  6. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.7.3
  7. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.6.15-1
  8. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.113-1Fixed in 7.2.12-1Fixed in 7.2.14-1

Event History

Feb 29, 2024
CVE Published
via MITRE·03:52 PM
Data Sourced
via MITRE·03:52 PM
Description
Data Sourced
via OSV·03:52 PM
DescriptionSeverityAffected Software
Mar 11, 2024
Data Sourced
via NVD·06:15 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2023-52490?

CVE-2023-52490 has a moderate severity level as it involves incorrect page mapping during memory migration in the Linux kernel.

2

How do I fix CVE-2023-52490?

To fix CVE-2023-52490, update the Linux kernel to version 6.6.15, 6.7.3, or 6.8, or apply the necessary patches provided by your Linux distribution.

3

Which Linux kernel versions are affected by CVE-2023-52490?

CVE-2023-52490 affects Linux kernel versions prior to 6.6.15, 6.7.3, and 6.8.

4

What components should I check for CVE-2023-52490?

Check the 'kernel' packages on Red Hat systems and 'linux' packages on Debian systems for vulnerabilities related to CVE-2023-52490.

5

Is CVE-2023-52490 specific to any distribution?

CVE-2023-52490 is relevant to multiple Linux distributions, including Red Hat and Debian.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203