UBUNTU-CVE-2026-97595: Use After Free
In the Linux kernel, the following vulnerability has been resolved: mac802154: fix use-after-free of sdata via queued RX frames The RX softirq producer ieee802154subifframe() queues received beacon and MAC-command frames onto local->rxbeaconlist / rxmaccmdlist and schedules a process-context worker, storing a raw macpkt->sdata (and skb->dev == sdata->dev) with neither a reference nor any locking: - the lists have no lock: the softirq producer listaddtail()s while the macwq worker listdel()s, so sibling interfaces on the same phy corrupt the list; - the workers dereference the interface after it may have been freed. mac802154rxmaccmdworker() touches macpkt->sdata directly, and mac802154rxbeaconworker() -> mac802154processbeacon() dereferences skb->dev (== sdata->dev). Removing an interface frees its sdata (netdevpriv) while a queued frame still points at it, so a later worker run is a use-after-free. Reproduced under KASAN by flooding a victim interface with MAC command frames and removing it (the beacon path is the same class via skb->dev): BUG: KASAN: slab-use-after-free in mac802154rxmaccmdworker+0x463/0x630 [mac802154] Read of size 4 at addr ffff888002f9ea18 by task kworker/u8:1/31 Workqueue: phy0-mac-cmds mac802154rxmaccmdworker [mac802154] Call Trace: mac802154rxmaccmdworker+0x463/0x630 [mac802154] processonework+0x611/0xe80 workerthread+0x52e/0xdc0 kthread+0x30c/0x630 retfromfork+0x2fd/0x3e0 Fix both lists together: - add local->rxlock and take it around every list access: the softirq producer (plain spinlock, softirq context) and the workers and flush (spinlockbh, process context); - pin the interface for the lifetime of a queued frame with netdevhold()/netdevput(), so the worker can safely dereference sdata / skb->dev even while the interface is being removed; - dequeue under the lock at the head and loop-drain the whole list in the workers (they previously processed one frame per run and relied on a later enqueue to drain the rest); - drop not-yet-started frames of an interface before it is unregistered, from ieee802154ifremove() (after the RCU grace period) and from the ieee802154removeinterfaces() loop -- the latter is the whole-phy teardown path, which does not go through ieee802154ifremove(). An in-flight worker that already dequeued a frame keeps its own netdev reference; unregisternetdevice() then waits it out in netdevruntodo(), which runs at rtnlunlock() (rtnl released) and after the interface has been closed, so it does not pin rtnl. A worker blocked in an association TX only delays that one interface's unregister (the usual "waiting for %s to become free"), it does not hold rtnl. netdevhold() is used for this reason instead of a cancelworksync() under rtnl, which would block on the worker's unbounded MLME TX wait via ieee802154syncqueue(). The mac-command worker additionally skips processing for a stopped interface (ieee802154sdatarunning()), avoiding a needless association response during teardown.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-42.42 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1016.17 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1016.18 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1015.16 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1 - Compensating control
Apply the mac802154 RX queue fix: protect rx_beacon_list and rx_mac_cmd_list with local->rx_lock (spin_lock in softirq context and spin_lock_bh in process context), retain each interface for queued frames with netdev_hold()/netdev_put(), dequeue at the head and drain each list in the workers, drop not-yet-started frames before interface unregister in ieee802154_if_remove() and ieee802154_remove_interfaces(), and skip MAC-command processing when ieee802154_sdata_running() is false.