summaryrefslogtreecommitdiff
path: root/scripts/Makefile.thinlto
diff options
context:
space:
mode:
authorKrystian Kaniewski <krystianmkaniewski@gmail.com>2026-08-12 10:16:41 +0200
committerLeon Romanovsky <leon@kernel.org>2026-09-01 09:43:32 -0400
commitef9fbe1b93f3b617b96e86d5cd76b3fa44514cb5 (patch)
treee82cf6035be96949628a8ad44fdf6b2957f22266 /scripts/Makefile.thinlto
parent2be77295316c2dff0a33c0dc3a65abdab4ccf796 (diff)
downloadlinux-stable-ef9fbe1b93f3b617b96e86d5cd76b3fa44514cb5.tar.gz
linux-stable-ef9fbe1b93f3b617b96e86d5cd76b3fa44514cb5.zip
RDMA/core: Reject unregistering netdevs in ib_get_eth_speed
ib_device_get_netdev() intentionally returns a referenced net_device even when it is unregistering, so matching and cleanup callers can still find the association. The reference keeps struct net_device allocated, but does not guarantee that the device remains operational. ib_get_eth_speed() uses the returned device operationally by invoking its ethtool callback. Although that call is made under RTNL, the function does not verify the registration state first. An asynchronous RDMA port query can therefore call into a netdev after NETDEV_UNREGISTER and ndo_uninit have completed. Check for NETREG_REGISTERED while holding RTNL and return -ENODEV for a device which is being unregistered. Keeping RTNL across the check and the ethtool operation prevents unregister from starting between them. Keep the speed fallback and warning under RTNL as well, so the warning can safely read netdev->name. Drop the netdev reference before releasing RTNL once all accesses to the device are complete. Fixes: d41861942fc5 ("IB/core: Add generic function to extract IB speed from netdev") Reported-by: syzbot+5fe14f2ff4ccbace9a26@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=5fe14f2ff4ccbace9a26 Signed-off-by: Krystian Kaniewski <krystianmkaniewski@gmail.com> Link: https://patch.msgid.link/20260812081708.32468-1-krystianmkaniewski@gmail.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions