CVE-2021-47491 mm: khugepaged: skip huge page collapse for special files

Medium 5.5 Published Updated

The Linux kernel allowed huge page collapse for special files, potentially causing bugs and denial of service.

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-2021-47491?

CVE-2021-47491 is a medium-severity vulnerability in Linux kernel, published on 22 May 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: skip huge page collapse for special files

The read-only THP for filesystems will collapse THP for files opened readonly and mapped with VM_EXEC. The intended usecase is to avoid TLB misses for large text segments. But it doesn't restrict the file types so a THP could be collapsed for a non-regular file, for example, block device, if it is opened readonly and mapped with EXEC permission. This may cause bugs, like [1] and [2].

This is definitely not the intended usecase, so just collapse THP for regular files in order to close the attack surface.

[[email protected]: fix vm_file check [3]]

Which versions are affected by CVE-2021-47491?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2021-47491?

Apply the vendor's patch.

Is CVE-2021-47491 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-47491, GHSA-8g2p-p68f-4wqr, UBUNTU-CVE-2021-47491.

Is CVE-2021-47491 in your software?

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

Check your SBOMs for free