Re: [PATCH v2 1/1] net: check before dereferencing netdev_ops during busy poll
From: David Miller
Date: Tue Mar 13 2018 - 10:51:24 EST
From: Josh Elsasser <jelsasser@xxxxxxxxxxx>
Date: Mon, 12 Mar 2018 22:32:00 -0700
> init_dummy_netdev() leaves its netdev_ops pointer zeroed. This leads
> to a NULL pointer dereference when sk_busy_loop fires against an iwlwifi
> wireless adapter and checks napi->dev->netdev_ops->ndo_busy_poll.
>
> Avoid this by ensuring napi->dev->netdev_ops is valid before following
> the pointer, avoiding the following panic when busy polling on a dummy
> netdev:
...
> Commit 79e7fff47b7b ("net: remove support for per driver ndo_busy_poll()")
> indirectly fixed this upstream in linux-4.11 by removing the offending
> pointer usage. No other users of napi->dev touch its netdev_ops.
>
> Fixes: 060212928670 ("net: add low latency socket poll")
> Fixes: ce6aea93f751 ("net: network drivers no longer need to implement ndo_busy_poll()") - 4.9.y
> Signed-off-by: Josh Elsasser <jelsasser@xxxxxxxxxxx>
Ok, queued up for -stable, thanks.