CVE-2021-47276 ftrace: Do not blindly read the ip address in ftrace_bug()

Medium 5.5 Published Updated

A flaw in the Linux kernel ftrace subsystem causes a system panic when handling invalid IP addresses during error reporting, leading to 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-47276?

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

ftrace: Do not blindly read the ip address in ftrace_bug()

It was reported that a bug on arm64 caused a bad ip address to be used for updating into a nop in ftrace_init(), but the error path (rightfully) returned -EINVAL and not -EFAULT, as the bug caused more than one error to occur. But because -EINVAL was returned, the ftrace_bug() tried to report what was at the location of the ip address, and read it directly. This caused the machine to panic, as the ip was not pointing to a valid memory address.

Instead, read the ip address with copy_from_kernel_nofault() to safely access the memory, and if it faults, report that the address faulted, otherwise report what was in that location.

Weakness: CWE-706

Which versions are affected by CVE-2021-47276?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2021-47276?

Apply the vendor's patch.

Is CVE-2021-47276 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-47276, GHSA-rgj4-j68m-986v, UBUNTU-CVE-2021-47276.

Is CVE-2021-47276 in your software?

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

Check your SBOMs for free