netfilter: nf_tables: skip expired catchall elements on insert and delete
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ aaa31047a6d25da0fa101da1ed544e1247949b40 · < 4fb8b1ccc475651e480e509de126bb9ce7f3cff9| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nf_tables: skip expired catchall elements on insert and delete
nft_setelem_catchall_insert() looks up duplicates with nft_set_elem_active() only, while nft_set_catchall_lookup() and the dump path additionally skip expired elements.
Once a catchall element with a timeout expires, this predicate drift makes it invisible to userspace dumps, yet it still blocks re-insertion: with NLM_F_EXCL the request fails with -EEXIST, and without it the request reports success but silently inserts nothing. The stale entry only goes away when the (user-tunable) gc interval elapses, so the catchall rule may silently stop matching for an arbitrarily long time after its first expiration.
The delete path shows the same drift: nft_setelem_catchall_deactivate() picks the first active-next entry in the catchall list, so with an expired entry still pending GC it retires the stale entry instead of the fresh one, and it deactivates an element that userspace no longer sees instead of failing with -ENOENT.
Align both walks with the lookup and dump predicates: only an element that is active and not expired counts as a duplicate or delete candidate, using the per-netns timestamp taken at transaction start, in line with the set backend .insert/.deactivate and catchall GC sync paths.
From the CVE record · Linux
The Linux kernel’s nf_tables catchall element insert and delete paths do not consistently skip expired elements. When a catchall element expires but remains pending garbage collection, an insert can fail or silently do nothing, and a delete can target the stale element instead of a fresh one. This can leave a catchall rule not matching until the user-configurable garbage-collection interval elapses; the input does not identify an attacker access requirement.
Engineers running Linux kernels that use nf_tables catchall elements with timeouts should check whether their kernel includes the fix; affected versions are not specified.