CVE-2021-47519 can: m_can: m_can_read_fifo: fix memory leak in error branch
A memory leak in the Linux kernel CAN driver allows attackers to exhaust system memory, potentially causing a denial of service.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-47519?
CVE-2021-47519 is a high-severity denial of service vulnerability in Linux kernel, published on 24 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
In the Linux kernel, the following vulnerability has been resolved:
can: m_can: m_can_read_fifo: fix memory leak in error branch
In m_can_read_fifo(), if the second call to m_can_fifo_read() fails, the function jump to the out_fail label and returns without calling m_can_receive_skb(). This means that the skb previously allocated by alloc_can_skb() is not freed. In other terms, this is a memory leak.
This patch adds a goto label to destroy the skb if an error occurs.
Issue was found with GCC -fanalyzer, please follow the link below for details.
Weakness: CWE-401
Which versions are affected by CVE-2021-47519?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2021-47519?
Apply the vendor's patch.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2021-47519 being exploited?
There is no known exploitation of CVE-2021-47519 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as DEBIAN-CVE-2021-47519, UBUNTU-CVE-2021-47519.