In the Linux kernel, the following vulnerability has been resolved:
netfilter: ipset: fix refcount race between list:set GC and swap
__ipsetputbyindex() resolved the index to a set pointer under RCU, then took ipsetreflock in __ipsetput() to decrement set->ref. ipsetswap() holds that same lock while swapping both the ipsetlist 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 BUGON(set->ref == 0). listsetgc() reaches this from timer softirq, which the nfnl mutex does not serialize against swap: an expiring list:set member calls listsetdel() -> ipsetputbyindex() while IPSETCMDSWAP runs on the referenced sets.
Resolve the index and decrement under ipsetreflock, as ipset_swap() already does, keeping the refcount tied to the index rather than to a stale set pointer.
kernel BUG at net/netfilter/ipset/ipsetcore.c:685! Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI RIP: 0010:ipsetputbyindex (net/netfilter/ipset/ipsetcore.c:870) Call Trace: <IRQ> listsetdel (net/netfilter/ipset/ipsetlistset.c:159) setcleanupentries (net/netfilter/ipset/ipsetlistset.c:181) listsetgc (net/netfilter/ipset/ipsetlistset.c:578) calltimerfn (kernel/time/timer.c:1748) _runtimers (kernel/time/timer.c:1799 kernel/time/timer.c:2374) runtimersoftirq (kernel/time/timer.c:2405) </IRQ> Kernel panic - not syncing: Fatal exception in interrupt