CVE-2021-46971 perf/core: Fix unconditional security_locked_down() call

Low 3.3 Published Updated

An attacker with specific SELinux policies can bypass lockdown restrictions by triggering unconditional security checks in the Linux kernel perf subsystem.

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

CVE-2021-46971 is a low-severity vulnerability in Linux kernel, published on 27 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:

perf/core: Fix unconditional security_locked_down() call

Currently, the lockdown state is queried unconditionally, even though its result is used only if the PERF_SAMPLE_REGS_INTR bit is set in attr.sample_type. While that doesn't matter in case of the Lockdown LSM, it causes trouble with the SELinux's lockdown hook implementation.

SELinux implements the locked_down hook with a check whether the current task's type has the corresponding "lockdown" class permission ("integrity" or "confidentiality") allowed in the policy. This means that calling the hook when the access control decision would be ignored generates a bogus permission check and audit record.

Fix this by checking sample_type first and only calling the hook when its result would be honored.

Which versions are affected by CVE-2021-46971?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2021-46971?

Apply the vendor's patch.

Is CVE-2021-46971 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-46971, GHSA-hmgx-rfwx-3mvq, UBUNTU-CVE-2021-46971.

Is CVE-2021-46971 in your software?

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

Check your SBOMs for free