CVE-2022-48991 mm/khugepaged: invoke MMU notifiers in shmem/file collapse paths

High 8.8 Published Updated

A use-after-free vulnerability in the Linux kernel's khugepaged component allows attackers to potentially execute code or escalate privileges by exploiting missing MMU notifier invocations.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2022-48991?

CVE-2022-48991 is a high-severity use after free vulnerability in Linux kernel, published on 21 Oct 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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

mm/khugepaged: invoke MMU notifiers in shmem/file collapse paths

Any codepath that zaps page table entries must invoke MMU notifiers to ensure that secondary MMUs (like KVM) don't keep accessing pages which aren't mapped anymore. Secondary MMUs don't hold their own references to pages that are mirrored over, so failing to notify them can lead to page use-after-free.

I'm marking this as addressing an issue introduced in commit f3f0e1d2150b ("khugepaged: add support of collapse for tmpfs/shmem pages"), but most of the security impact of this only came in commit 27e1f8273113 ("khugepaged: enable collapse pmd for pte-mapped THP"), which actually omitted flushes for the removal of present PTEs, not just for the removal of empty page tables.

Weakness: CWE-416

Which versions are affected by CVE-2022-48991?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2022-48991?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2022-48991 being exploited?

There is no known exploitation of CVE-2022-48991 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2022-48991, GHSA-8xxh-66cx-j9cj, UBUNTU-CVE-2022-48991.

Is CVE-2022-48991 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free