mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 20:14:06 +02:00
net: avoid nul-deref trying to bind mp to incapable device
Sashiko points out that we use qops in __net_mp_open_rxq()
but never validate they are null. This was introduced when
check was moved from netdev_rx_queue_restart().
Look at ops directly instead of the locking config.
qops imply netdev_need_ops_lock(). We used netdev_need_ops_lock()
initially to signify that the real_num_rx_queues check below
is safe without rtnl_lock, but I'm not sure if this is actually
clear to most people, anyway.
Fixes: da7772a2b4 ("net: move mp->rx_page_size validation to __net_mp_open_rxq()")
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Mina Almasry <almasrymina@google.com>
Link: https://patch.msgid.link/20260404001938.2425670-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
f2777d5cb5
commit
944b3b734c
|
|
@ -117,7 +117,7 @@ int __net_mp_open_rxq(struct net_device *dev, unsigned int rxq_idx,
|
|||
struct netdev_rx_queue *rxq;
|
||||
int ret;
|
||||
|
||||
if (!netdev_need_ops_lock(dev))
|
||||
if (!qops)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (rxq_idx >= dev->real_num_rx_queues) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user