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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Dumazet <eric.dumazet@xxxxxxxxx> 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux