CVE-2024-57947 netfilter: nf_set_pipapo: fix initial map fill

Critical 9.8 Published Updated

A flaw in the Linux kernel netfilter pipapo algorithm leaks memory bits, potentially allowing attackers to read sensitive kernel memory.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-57947?

CVE-2024-57947 is a critical vulnerability in Linux kernel, published on 23 Jan 2025. 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:

netfilter: nf_set_pipapo: fix initial map fill

The initial buffer has to be inited to all-ones, but it must restrict it to the size of the first field, not the total field size.

After each round in the map search step, the result and the fill map are swapped, so if we have a set where f->bsize of the first element is smaller than m->bsize_max, those one-bits are leaked into future rounds result map.

This makes pipapo find an incorrect matching results for sets where first field size is not the largest.

Followup patch adds a test case to nft_concat_range.sh selftest script.

Thanks to Stefano Brivio for pointing out that we need to zero out the remainder explicitly, only correcting memset() argument isn't enough.

Weakness: CWE-401

Which versions are affected by CVE-2024-57947?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-57947?

Apply the vendor's patch.

Is CVE-2024-57947 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-57947, DEBIAN-CVE-2024-57947, GHSA-2885-grqh-2673, ROOT-OS-DEBIAN-11-CVE-2024-57947, UBUNTU-CVE-2024-57947.

Is CVE-2024-57947 in your software?

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

Check your SBOMs for free