Thread (1 message) 1 message, 1 author, 2014-05-03

Re: [PATCH net,stable] net: cdc_mbim: __vlan_find_dev_deep need rcu_read_lock

From: Bjørn Mork <hidden>
Date: 2014-05-03 09:16:50

Eric Dumazet [off-list ref] writes:
While this 'removes' the warning, this doesn't solve the fundamental
problem.

If you write :

rcu_read_lock();
netdev = __vlan_find_dev_deep(...)
rcu_read_unlock();

Then you cannot dereference netdev safely after the unlock.

In order to do so, you need to take a reference on netdev (aka
dev_hold()) before doing rcu_read_unlock();

And of course, release it later (aka dev_put()) when you are done with
netdev.
Doh! Now that you tell me, this is pretty obvious.  Thanks.  Will fix
and resubmit.


Bjørn
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help