diff options
| author | Ibrahim Hashimov <security@auditcode.ai> | 2026-07-21 23:12:28 +0200 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-07-23 10:37:46 -0700 |
| commit | 234e5e898b713bc0b3a631b6f002897f43d046c8 (patch) | |
| tree | b416ca77899021979c74b2c3d78d2d0f4abed90f /include/uapi/linux/rfkill.h | |
| parent | 9b2854f86f0b56e9027d68e7a3fc909d1a9b566f (diff) | |
| download | linux-234e5e898b713bc0b3a631b6f002897f43d046c8.tar.gz linux-234e5e898b713bc0b3a631b6f002897f43d046c8.zip | |
mac802154: hold an interface reference across the scan worker
mac802154_scan_worker() captures the scanning sub-interface under RCU
and then keeps dereferencing sdata->dev after rcu_read_unlock() and
outside the rtnl -- in the failure traces, in
mac802154_transmit_beacon_req() (skb->dev = sdata->dev), and in the
end_scan cleanup. Nothing keeps that netdev alive across the worker
iteration.
A concurrent DEL_INTERFACE or PHY removal can unregister the interface
once the worker drops the rtnl between its two drv_set_channel()
sections. unregister_netdevice() frees the netdev asynchronously from
netdev_run_todo() with the rtnl already dropped, so neither holding the
rtnl nor the per-PHY IEEE802154_IS_SCANNING flag prevents a stale worker
iteration from dereferencing the freed netdev -- a KASAN
slab-use-after-free, reachable by racing TRIGGER_SCAN against
DEL_INTERFACE (both CAP_NET_ADMIN).
Pin the netdev with netdev_hold() while the RCU read lock is still held,
and release it at every worker exit.
Fixes: 57588c71177f ("mac802154: Handle passive scanning")
Cc: stable@vger.kernel.org
Signed-off-by: Ibrahim Hashimov <security@auditcode.ai>
Link: https://patch.msgid.link/20260721211228.34578-1-security@auditcode.ai
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/uapi/linux/rfkill.h')
0 files changed, 0 insertions, 0 deletions
