Thread (4 messages) 4 messages, 2 authors, 2018-03-13

Re: [PATCH 1/1] net: check dev->reg_state before deref of napi netdev_ops

flat view

From: Josh Elsasser <hidden>
Date: 2018-03-13 05:17:58
Also in: lkml

On Mon, Mar 12, 2018 at 4:17 PM, Cong Wang [off-list ref] wrote:
On Sun, Mar 11, 2018 at 12:22 PM, Josh Elsasser [off-list ref] wrote:
quoted
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 that napi->dev is not a dummy device before
dereferencing napi dev's netdev_ops, preventing the following panic:
Hmm, how about just checking ->netdev_ops? Checking reg_state looks
odd, although works.
Fair point. I was trying to differentiate between an unexpected
NULL pointer and a dummy netdev, but I guess it was clever
at the expense of readability.

I'll push up a v2 that just does the obvious.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help