[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87ppjv8bnh.fsf@nemi.mork.no>
Date: Sat, 03 May 2014 11:16:50 +0200
From: Bjørn Mork <bjorn@...k.no>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: netdev@...r.kernel.org, linux-usb@...r.kernel.org,
Greg Suarez <gsuarez@...thmicro.com>,
Oliver Neukum <oliver@...kum.org>
Subject: Re: [PATCH net,stable] net: cdc_mbim: __vlan_find_dev_deep need rcu_read_lock
Eric Dumazet <eric.dumazet@...il.com> 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 netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists