KernelScan.io

HIGH Introduced in 3.8

netfilter ipset Refcount Race

CVE-2026-74748

CVSS 7.8 / 10.0 NVD

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

KernelScan AI4.6MEDIUM

01

In the Linux kernel, the following vulnerability has been resolved: netfilter: ipset: fix refcount race between list:set GC and swap __ip_set_put_byindex() resolved the index to a set pointer under RCU, then took ip_set_ref_lock in __ip_set_put() to decrement set->ref. ip_set_swap() holds that same lock while swapping both the ip_set_list slots and the two sets' ref counters, so it can interleave between the dereference and the lock acquisition, leaving the caller to decrement a set whose reference already moved to the other index and hit BUG_ON(set->ref == 0). list_set_gc() reaches this from timer softirq, which the nfnl mutex does not serialize against swap: an expiring list:set member calls list_set_del() -> ip_set_put_byindex() while IPSET_CMD_SWAP runs on the referenced sets. Resolve the index and decrement under ip_set_ref_lock, as ip_set_swap() already does, keeping the refcount tied to the index rather than to a stale set pointer. kernel BUG at net/netfilter/ipset/ip_set_core.c:685! Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI RIP: 0010:ip_set_put_byindex (net/netfilter/ipset/ip_set_core.c:870) Call Trace: <IRQ> list_set_del (net/netfilter/ipset/ip_set_list_set.c:159) set_cleanup_entries (net/netfilter/ipset/ip_set_list_set.c:181) list_set_gc (net/netfilter/ipset/ip_set_list_set.c:578) call_timer_fn (kernel/time/timer.c:1748) __run_timers (kernel/time/timer.c:1799 kernel/time/timer.c:2374) run_timer_softirq (kernel/time/timer.c:2405) </IRQ> Kernel panic - not syncing: Fatal exception in interrupt

02

Engine v0.6.0

Risk summary

A race condition in the Linux kernel's netfilter ipset subsystem can cause a kernel panic when a list:set garbage collection timer runs concurrently with an IPSET_CMD_SWAP operation. An unprivileged local user who can create and manipulate ipsets can trigger this to cause a denial of service.

Affectednet/netfilter/ipset/ip_set_core.c (netfilter ipset)

Vulnerability analysis

A race condition exists between the ipset garbage-collection timer and a swap operation. The timer looks up a set by its index without holding the lock that protects swaps, then updates the set's reference count. If a swap moves the set to a different index in between, the timer decreases the reference count of the wrong set. When that count hits zero unexpectedly, an internal consistency check crashes the kernel. The fix performs the lookup and reference-count update while holding the same lock used during swaps, keeping the index valid throughout. A local user who can create ipsets and run swap commands can trigger this; on most configurations that ability is available inside user namespaces.

03

BranchIntroducedFixed inPatch commit
5.103.85.10.26697a01de0c632
6.13.86.1.184b0aab9dd1a34
6.63.86.6.153b891e7a6bb06
6.123.86.12.10520cb13a523f0
7.13.87.1.1024ffcb1e1688
mainline3.87.20c8886827165
5.153.85.15.217c21afc7c216a
6.183.86.18.46cb20da33839f
cip/4.193.84.19.325-cip136193b0894783d
cip/4.19-rt3.84.19.325-cip136-rt50193b0894783d
cip/4.43.84.4.302-cip115d4edb9b07649
cip/4.4-rt3.84.4.302-cip115-rt63d4edb9b07649
cip/5.103.85.10.268-cip7797a01de0c632
cip/5.10-rt3.85.10.268-cip77-rt3497a01de0c632
cip/6.13.86.1.187-cip60b0aab9dd1a34
cip/6.123.86.12.108-cip3120cb13a523f0