CVE-2026-139348: net/smc: hold a reference on net_device returned by pnet_find_base_ndev()
In the Linux kernel, the following vulnerability has been resolved:
net/smc: hold a reference on netdevice returned by pnetfindbasendev()
pnetfindbasendev() resolves the base netdevice for stacked devices under RTNL, then drops the lock and returns the raw pointer without taking a reference. All three callers dereference the pointer after RTNL has been released, creating a use-after-free window if the device is concurrently unregistered.
Take a reference with netdevhold() before dropping RTNL and add the matching netdevput() in every return path of the three callers:
- smcpnetaddeth() - smcpnetfindrocebypnetid() - smcpnetfindismbypnetid()
Found by code analysis, confirmed with a proof-of-concept that triggers a KASAN slab-use-after-free report.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In pnet_find_base_ndev() callers, take a netdev_hold() reference before dropping RTNL and call the matching netdev_put() on every return path in smc_pnet_add_eth(), smc_pnet_find_ism_by_pnetid(), and smc_pnet_find_roce_by_pnetid().