CVE-2024-26924: netfilter: nft_set_pipapo: do not free live element
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nft_set_pipapo: do not free live element
Pablo reports a crash with large batches of elements with a
back-to-back add/remove pattern. Quoting Pablo:
add_elem("00000000") timeout 100 ms
...
add_elem("0000000X") timeout 100 ms
del_elem("0000000X") <---------------- delete one that was just added
...
add_elem("00005000") timeout 100 ms
1) nft_pipapo_remove() removes element 0000000X
Then, KASAN shows a splat.
Looking at the remove function there is a chance that we will drop a
rule that maps to a non-deactivated element.
Removal happens in two steps, first we do a lookup for key k and return the
to-be-removed element and mark it as inactive in the next generation.
Then, in a second step, the element gets removed from the set/map.
The _remove function does not work correctly if we have more than one
element that share the same key.
This can happen if we insert an element into a set when the set already
holds an element with same key, but the element mapping to the existing
key has timed out or is not active in the next generation.
In such case its possible that removal will unmap the wrong element.
If this happens, we will leak the non-deactivated element, it becomes
unreachable.
The element that got deactivated (and will be freed later) will
remain reachable in the set data structure, this can result in
a crash when such an element is retrieved during lookup (stale
pointer).
Add a check that the fully matching key does in fact map to the element
that we have marked as inactive in the deactivation step.
If not, we need to continue searching.
Add a bug/warn trap at the end of the function as well, the remove
function must not ever be called with an invisible/unreachable/non-existent
element.
v2: avoid uneeded temporary variable (Stefano)
Security readout for executives and security teams
Plain-English summary
This Linux kernel flaw can leave a freed netfilter set element accessible after rapid add-and-remove operations involving duplicate keys. A later lookup can dereference stale memory and crash the system. The supplied CVSS score is 7.8 (high), with local access and low privileges required; the bundle does not establish remote exploitation or observed attacks.
Executive priority
Treat this as a high-priority kernel patching item, especially on shared Linux systems with untrusted local users. It is not evidenced as an internet-scale emergency: access is local, KEV is false, and active exploitation is not reported. Patch through accelerated kernel maintenance, with reboot verification and vendor confirmation of backports.
Technical view
In nft_set_pipapo, two-stage removal can unmap the wrong element when multiple elements share a key and one is timed out or inactive. The intended element may leak, while a deactivated element remains reachable and is later freed. A subsequent lookup can follow that stale pointer, producing a kernel crash and potentially the high confidentiality, integrity, and availability impacts represented by the CVSS vector.
Likely exposure
Linux systems running affected kernel branches that use nftables pipapo sets are the likely exposure. The supplied version data is flattened and does not clearly express every fixed boundary, while distributions may backport patches. Determine status from the exact running kernel package, distributor advisory, and applicable stable-kernel commit rather than version strings alone.
Exploitation context
The CVSS vector describes local, low-complexity exploitation requiring low privileges and no user interaction. KEV is false, and no supplied source reports active exploitation or a public exploit. The demonstrated outcome is a KASAN-detected crash; the CVSS vector rates potential confidentiality, integrity, and availability impact high, but practical exploitation beyond crashing is not established.
Researcher notes
The faulty removal can select the wrong element when identical keys coexist because an existing mapping timed out or is inactive in the next generation. One element becomes unreachable while a deactivated element remains reachable and is later freed, creating a stale-pointer lookup. The record assigns CWE-476, although the narrative specifically describes stale memory. Exact branch boundaries require vendor or commit-level confirmation.
Mitigation direction
Install the distributor-supported kernel update containing the applicable nft_set_pipapo fix.
Reboot into the updated kernel and remove vulnerable kernels from normal boot selection.
Compare vendor backports against referenced stable-kernel commits; do not rely only on upstream version numbers.
If an update is unavailable, obtain product-specific mitigation guidance from the Linux distributor.
Prioritize shared or sensitive Linux hosts where local low-privileged access exists.
Validation and detection
Record the exact running kernel release and package build on every Linux host.
Check each build against its distributor advisory and the applicable stable-kernel fix commit.
After reboot, confirm the running kernel is the remediated package, not merely installed.
Review kernel logs for KASAN reports or crashes referencing nft_set_pipapo or nft_pipapo_remove.
Retest inventory until no in-scope host maps to an affected, unpatched build.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-476: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-476 · source CWE mapping
NULL Pointer Dereference
NULL Pointer Dereference represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.