Description
In the Linux kernel, the following vulnerability has been resolved: net/smc: hold a reference on net_device returned by pnet_find_base_ndev() pnet_find_base_ndev() resolves the base net_device 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 netdev_hold() before dropping RTNL and add the matching netdev_put() in every return path of the three callers: - smc_pnet_add_eth() - smc_pnet_find_roce_by_pnetid() - smc_pnet_find_ism_by_pnetid() Found by code analysis, confirmed with a proof-of-concept that triggers a KASAN slab-use-after-free report.
Affected products
Version statuses are supplied by the assigning organization. Consult the original record for detailed ranges and platform conditions.
Linux Linux
Default version status: unaffected
0afff91c6f5ecef27715ea71e34dc2baacba1060 to < e3f992158d96d47aae01aa76c5e35af941d726c2affected0afff91c6f5ecef27715ea71e34dc2baacba1060 to < 6176fa6b14c1ab439936b6d8ceda9a38dfb149ddaffected0afff91c6f5ecef27715ea71e34dc2baacba1060 to < bd8ea7ddb909807b2200e4d72b38a0bc7d746298affected0afff91c6f5ecef27715ea71e34dc2baacba1060 to < ea3bf68cfa530b4c1e5a4fe15fca5409a32b8c98affected0afff91c6f5ecef27715ea71e34dc2baacba1060 to < 521c06e5d15386013de2196aa6917039ecf192ceaffected0afff91c6f5ecef27715ea71e34dc2baacba1060 to < e6435b2cc5fdf008cdb67ad9a811a266e8ac9c1eaffected
Linux Linux
Default version status: affected
4.19affected0 to < 4.19unaffected6.1.193 to ≤ 6.1.*unaffected6.6.163 to ≤ 6.6.*unaffected6.12.119 to ≤ 6.12.*unaffected6.18.65 to ≤ 6.18.*unaffected7.3.6 to ≤ 7.3.*unaffected7.4-rc1 to ≤ *unaffected
References
- https://git.kernel.org/stable/c/e3f992158d96d47aae01aa76c5e35af941d726c2 ↗
- https://git.kernel.org/stable/c/6176fa6b14c1ab439936b6d8ceda9a38dfb149dd ↗
- https://git.kernel.org/stable/c/bd8ea7ddb909807b2200e4d72b38a0bc7d746298 ↗
- https://git.kernel.org/stable/c/ea3bf68cfa530b4c1e5a4fe15fca5409a32b8c98 ↗
- https://git.kernel.org/stable/c/521c06e5d15386013de2196aa6917039ecf192ce ↗
- https://git.kernel.org/stable/c/e6435b2cc5fdf008cdb67ad9a811a266e8ac9c1e ↗