Write-up, KASAN reproducer, and A/B test runner for CVE-2026-74583, a race-condition use-after-free in the Linux route4 traffic classifier enabling local privilege escalation.
A race-condition use-after-free in the Linux kernel's route4 traffic classifier
(net/sched/cls_route.c). When a filter was deleted while packets were being classified, the
kernel could keep a pointer to the filter in a small cache and read it after the filter was freed.
A normal local user can trigger it, and it can be used for local privilege escalation to root.
The bug dates back to v3.18 (2014). It was fixed in Linux 7.2 and backported to the stable kernels. This repository has a write-up, a KASAN reproducer, and the test logs.
| CVE | CVE-2026-74583 |
| Where | net/sched/cls_route.c, route4_classify() and route4_set_fastmap() |
| Bug type | Use-after-free caused by a race between packet classification and filter deletion |
| Added in | v3.18, commit 1109c00547fc ("net: sched: RCU cls_route", 2014) |
| Fixed in | v7.2, commit 47d7f7051253 |
| Who can trigger it | A normal local user, on systems that allow unprivileged user namespaces |
| Impact | Local privilege escalation to root (exploit not published) |
| CVSS 3.1 | 7.8 (High), from the CVE record: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| Found by | Santosh Kalluri |
The reader, route4_classify(), walks the filter list under RCU. When it finds a matching filter,
it stores that filter in the fastmap with route4_set_fastmap(), so the next packet can skip the
search. The writer, route4_delete() (and route4_change() when it replaces a filter), unlinks the
filter, clears the fastmap with route4_reset_fastmap(), and queues the filter to be freed after
an RCU grace period.
Clearing the cache before the free is not enough. This order of events breaks it:
f.f, clears the fastmap, and queues f to be freed.route4_set_fastmap() and stores f in the fastmap, after the clear.f is freed.f->res from freed memory.The fastmap stores raw filter pointers. Clearing it once does not stop a reader that already holds a pointer from storing it again, so step 3 undoes step 2.
The fix adds a dying flag to each filter. The writer sets it under the existing fastmap_lock
when it removes the filter, and the reader no longer stores a filter in the fastmap once it is
marked as dying. Because both sides use the same lock, either the reader stores first and the
writer's clear removes the entry, or the writer marks first and the reader skips the store.
The fix was written by Jamal Hadi Salim, based on a design suggested by Paolo Abeni.
The reproducer runs as a normal user. It creates its own user and network namespace, which gives it
CAP_NET_ADMIN inside that namespace only. Inside it, it:
The race window is very short. To make it easier to hit, the reproducer uses a known timer and epoll technique from published research (ExpRace, USENIX Security 2021) to briefly stall a CPU at the right moment. It needs no kernel changes, debug options, or root.
It only triggers the bug. It does not try to exploit it. In the test setup a normal user cannot read the kernel log, so the reproducer only reports that it saw the race. The runner below checks the kernel log for the KASAN report.
On a KASAN kernel, the read of the freed filter is reported as a slab use-after-free in
route4_classify(). The 16 bytes read are f->res, the filter's classification result, which the
kernel then uses to pick a traffic class for the packet.
This bug can be used for local privilege escalation to root. I wrote a working exploit, but it is not included in this repository.
Limits:
CAP_NET_ADMIN.CONFIG_NET_CLS_ROUTE4, CONFIG_NET_SCH_HTB). Many
distributions build them as modules that load on demand.The bug exists from v3.18 up to the fixed versions below. These match the official CVE record.
| Branch | First fixed version |
|---|---|
| mainline | 7.2 |
| 7.1.y | 7.1.9 |
| 6.18.y | 6.18.45 |
| 6.12.y | 6.12.104 |
| 6.6.y | 6.6.152 |
| 6.1.y | 6.1.183 |
| 5.15.y | 5.15.216 |
| 5.10.y | 5.10.265 |
Quick way to check a kernel source tree: look for a dying field in struct route4_filter in
net/sched/cls_route.c. If it is there, the tree is fixed.
Use throwaway VMs. On a vulnerable KASAN kernel the reproducer produces a use-after-free report.
8cdeaa50eae8) with configs/kasan.config.
This is the vulnerable kernel.47d7f7051253 to the same source and build again with the same config.
This is the fixed kernel.make
/dev/vda, allows root SSH with a test key, and
allows unprivileged user namespaces.python3 run_kasan_ab.py \
--vulnerable-kernel vuln/arch/x86/boot/bzImage --vulnerable-vmlinux vuln/vmlinux \
--patched-kernel fixed/arch/x86/boot/bzImage --patched-vmlinux fixed/vmlinux \
--vulnerable-source vuln-src --patched-source fixed-src \
--image test.img --private-key test-key --public-key test-key.pub \
--reproducer artifacts/route4_kasan_repro --seconds 180 --output results/my-run
For each kernel, the runner boots a fresh QEMU/KVM snapshot (4 vCPUs, 4 GiB RAM) and creates a new
normal user with no capabilities. It runs the reproducer as that user for up to 180 seconds. It
only counts a result if the KASAN report names route4_classify, allocation in route4_change,
the free in route4_delete_filter_work, and that user's UID. Other crashes or warnings do not
count. A run with no report does not prove a kernel is safe.
make test runs the runner's unit tests.
Run on 2026-11-01 with the exact binary in artifacts/. QEMU/KVM, 4 vCPUs, AMD
x86-64 host. The reproducer ran as normal user UID 23456.
| Trial | Vulnerable kernel | Fixed kernel | Result |
|---|---|---|---|
| 1 | KASAN use-after-free (9,545 attempts in 180 s) | no KASAN (55,015 attempts in 180 s) | PASS |
| 2 | KASAN use-after-free (2,127 attempts in 180 s) | no KASAN (58,555 attempts in 180 s) | PASS |
Earlier runs in August and November 2026 with an earlier version of the reproducer gave the same result.