
Write-up, KASAN evidence, and C reproducer for CVE-2026-53157, a use-after-free in the Linux Phonet phonet_device_destroy() path, with QEMU test harness.
A use-after-free in the Linux kernel's Phonet code (net/phonet). When a network device was
removed, the kernel could free a Phonet record while another task was still reading it.
The bug dates back to v2.6.33 (2009). It was fixed in Linux 7.1 and backported to the stable kernels. This repository has a write-up, a reproducer, and the test logs.
| CVE | CVE-2026-53157 |
| Where | net/phonet/pn_dev.c, function phonet_device_destroy() |
| Bug type | Use-after-free (memory freed without waiting for RCU readers to finish) |
| Added in | v2.6.33, commit eeb74a9d45f7 ("Phonet: convert devices list to RCU", 2009) |
| Fixed in | v7.1, commit 71de0177b28d |
| Who can trigger it | Root (needs CAP_NET_ADMIN and CAP_SYS_ADMIN in the initial user namespace) |
| CVSS 3.1 | NVD lists 7.8 (High), assuming a low-privileged attacker. Adding a Phonet address requires root, so with PR:H the score is 6.7 (Medium): CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H |
| Found and fixed by | Santosh Kalluri |
The kernel keeps one struct phonet_device for each network device that has Phonet addresses.
These records sit on a list. Readers walk the list under RCU, a kernel mechanism that lets readers
work without taking a lock. The rule with RCU is simple: after you take an item off the list,
you must wait until all current readers are done before you free it.
phonet_device_destroy() broke that rule. It took the item off the list and freed it immediately:
spin_lock(&pndevs->lock);
pnd = __phonet_get(dev);
if (pnd)
list_del_rcu(&pnd->list);
spin_unlock(&pndevs->lock);
if (pnd) {
...
kfree(pnd); /* freed right away, readers may still use it */
}
list_del_rcu() only removes the item from the list. A reader that was already walking the list can
still have a pointer to it. The other function that frees the same kind of object,
phonet_address_del(), already did it the right way with kfree_rcu().
One of those readers is getaddr_dumpit(), which answers "list all Phonet addresses" requests
(RTM_GETADDR):
rcu_read_lock();
list_for_each_entry_rcu(pnd, &pndevs->list, list) {
...
memcpy(addrs, pnd->addrs, sizeof(pnd->addrs)); /* reads freed memory */
for_each_set_bit(addr, addrs, 64) {
...
err = fill_addr(skb, READ_ONCE(pnd->netdev->ifindex), ...); /* follows a pointer from freed memory */
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ static void phonet_device_destroy(struct net_device *dev)
for_each_set_bit(addr, pnd->addrs, 64)
phonet_address_notify(net, RTM_DELADDR, ifindex, addr);
- kfree(pnd);
+ kfree_rcu(pnd, rcu);
}
}
kfree_rcu() waits until all current RCU readers are done and then frees the memory. The struct
already had the rcu field it needs, so nothing else had to change.
Two things have to happen at the same time:
RTM_NEWADDR), then delete
the device (RTM_DELLINK). Deleting the device ends up in phonet_device_destroy(), which frees
the record.RTM_GETADDR).poc/pn_uaf_repro.c runs 8 threads doing the first part and 8 threads doing
the second. It runs inside its own network namespace. It only triggers the bug. It does not try to
exploit it.
What I saw (logs in evidence/):
getaddr_dumpit() reads 8 bytes from a freed 64-byte object
(kmalloc-64 cache).getaddr_dumpit() follows a stale
pnd->netdev pointer and the kernel hits a general protection fault. Every vulnerable run ended
in a panic. The extra KASAN reports later in the same run are side effects of the list walk going
through freed memory. They are not separate bugs.Limits:
CAP_NET_ADMIN and CAP_SYS_ADMIN against the
initial user namespace. A normal user inside their own user namespace gets EPERM. I tested this
(test 1 below). Listing addresses needs no special rights, but on its own it does not free anything.CONFIG_PHONET). Ubuntu, for example, builds it as a module
(CONFIG_PHONET=m).The bug exists from v2.6.33 up to the fixed versions below. These match the official CVE record.
| Branch | First fixed version |
|---|---|
| mainline | 7.1 |
| 7.0.y | 7.0.13 |
| 6.18.y | 6.18.36 |
| 6.12.y | 6.12.95 |
| 6.6.y | 6.6.144 |
| 6.1.y | 6.1.177 |
| 5.15.y | 5.15.211 |
| 5.10.y | 5.10.260 |
Quick way to check a kernel source tree: look at the last kfree in phonet_device_destroy().
kfree_rcu(pnd, rcu) means fixed. kfree(pnd) means vulnerable.
Use a throwaway VM. The reproducer needs root, and on a vulnerable kernel it will crash the kernel.
x86_64_defconfig plus kvm_guest.config,
then add the options in test/kasan-phonet.config.
This is the fixed kernel.test/revert-fix.diff and build again. It changes only the one line
shown above. This is the vulnerable kernel.test/build_initramfs.sh /usr/bin/busybox initramfs.cpio.gz
test/run_qemu.sh path/to/bzImage initramfs.cpio.gz 60
The initramfs runs two tests:
EPERM.Linux v7.1, KASAN, QEMU/KVM, 4 vCPUs.
| Date | Kernel | Runs | KASAN use-after-free | Kernel crash | Test 1 (normal user) |
|---|---|---|---|---|---|
| 2026-10-08 | v7.1 (fixed) | 3 × 60 s | 0 of 3 | 0 of 3 | EPERM |
| 2026-10-08 | v7.1 with the fix reverted | 3 | 3 of 3, first report 5–20 s after boot | 3 of 3 | EPERM |
| 2026-11-01 | v7.1 (fixed), fresh build | 2 × 60 s | 0 of 2 | 0 of 2 | EPERM |
| 2026-11-01 | v7.1 with the fix reverted, fresh build | 3 | 3 of 3, first report 4.7–6.4 s after boot | 3 of 3 | EPERM |
A KASAN report from a vulnerable run (evidence/kasan_vulnerable.txt):