CVE-2026-139280: netfilter: nft_set_rbtree: narrow down range completion to anonymous sets
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nftsetrbtree: narrow down range completion to anonymous sets
For anonymous sets, when adjacent ranges are found, the end element is not added to the set to pack the set representation. Use next start element to complete this interval.
Jérémy Jean says:
Consider two ranges in a netfilter verdict map: keys 10-19 accept packets, and keys 30-39 jump to chain 'victim'. Now, delete the end marker at 20. The lookup array now uses element 30 as the first range's end, so an INTERVALEND query for key 15 returns element 30, including its jump verdict and chain pointer. This can make KASAN reports a UAF after the GC releases reference chain for 30 that has expired:
BUG: KASAN: slab-use-after-free in nftverdictdump+0xdd/0x110 Read of size 8 at addr ff110000009dfb58 by task repro/50 ... Call Trace: ... nftverdictdump+0xdd/0x110 nftdatadump+0x4d/0x80 nftablesfillsetelem+0x30b/0x8a0 ? asanmemcpy+0x3c/0x60 nftablesfillseteleminfo+0x1b0/0x200 nftgetsetelem+0x3fd/0x4b0 ... Freed by task 24: ... kfree+0x1a5/0x280 nftablestransdestroywork+0x2cb/0x520
Affected Software
Event History
Frequently Asked Questions
Which nftables configuration is affected?
The issue is limited to anonymous sets using range completion. The described trigger involves a netfilter verdict map with adjacent key ranges that carry different verdict data.
What sequence can lead to the use-after-free?
An end marker between adjacent ranges is deleted, causing the lookup array to use the next range's start element as the prior range's end. An INTERVAL_END query can then return verdict and chain-pointer data from that next element after its referenced chain has been released by garbage collection.
How might an affected system be identified?
The reported symptom is a KASAN slab-use-after-free in nft_verdict_dump, reached through nft_data_dump, nf_tables_fill_setelem, nf_tables_fill_setelem_info, and nft_get_set_elem. The freeing path shown includes nf_tables_trans_destroy_work.