CVE-2021-47243 sch_cake: Fix out of bounds when parsing TCP options and header

High 7.1 Published Updated

An out-of-bounds read in the Linux kernel's CAKE qdisc TCP option parser allows attackers to read adjacent memory or cause a crash.

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

CVE-2021-47243 is a high-severity memory corruption 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:

sch_cake: Fix out of bounds when parsing TCP options and header

The TCP option parser in cake qdisc (cake_get_tcpopt and cake_tcph_may_drop) could read one byte out of bounds. When the length is 1, the execution flow gets into the loop, reads one byte of the opcode, and if the opcode is neither TCPOPT_EOL nor TCPOPT_NOP, it reads one more byte, which exceeds the length of 1.

This fix is inspired by commit 9609dad263f8 ("ipv4: tcp_input: fix stack out of bounds when parsing TCP options.").

v2 changes:

Added doff validation in cake_get_tcphdr to avoid parsing garbage as TCP header. Although it wasn't strictly an out-of-bounds access (memory was allocated), garbage values could be read where CAKE expected the TCP header if doff was smaller than 5.

Weakness: CWE-125

Which versions are affected by CVE-2021-47243?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2021-47243?

Apply the vendor's patch.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2021-47243 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-47243, GHSA-6pvp-xcj5-pgh8, UBUNTU-CVE-2021-47243.

Is CVE-2021-47243 in your software?

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

Check your SBOMs for free