CVE-2021-46990 powerpc/64s: Fix crashes when toggling entry flush barrier

Medium 5.5 Published Updated

A race condition in the Linux kernel powerpc entry flush mitigation can cause system crashes when toggling the barrier via debugfs.

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-46990?

CVE-2021-46990 is a medium-severity vulnerability in Linux kernel, published on 28 Feb 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:

powerpc/64s: Fix crashes when toggling entry flush barrier

The entry flush mitigation can be enabled/disabled at runtime via a debugfs file (entry_flush), which causes the kernel to patch itself to enable/disable the relevant mitigations.

However depending on which mitigation we're using, it may not be safe to do that patching while other CPUs are active. For example the following crash:

sleeper[15639]: segfault (11) at c000000000004c20 nip c000000000004c20 lr c000000000004c20

Shows that we returned to userspace with a corrupted LR that points into the kernel, due to executing the partially patched call to the fallback entry flush (ie. we missed the LR restore).

Fix it by doing the patching under stop machine. The CPUs that aren't doing the patching will be spinning in the core of the stop machine logic. That is currently sufficient for our purposes, because none of the patching we do is to that code or anywhere in the vicinity.

Which versions are affected by CVE-2021-46990?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2021-46990?

Apply the vendor's patch.

Is CVE-2021-46990 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-46990, GHSA-qg29-4gg5-8r2w, UBUNTU-CVE-2021-46990.

Is CVE-2021-46990 in your software?

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

Check your SBOMs for free