netfilter: nft_set_pipapo: do not free live element
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 3c4287f62044a90e73a561aa05fc46e62da173da · < 3cfc9ec039af60dbd8965ae085b2c2ccdcfbe1cc| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
The Linux kernel’s netfilter nft_set_pipapo code can remove the wrong element when elements share a key, leaving a freed element reachable through the set. Large batches with back-to-back additions and removals can trigger a crash during lookup. The input does not specify whether exploitation requires local access, authentication, or user interaction.
Engineers running the Linux kernel should check their builds; affected versions are not specified.