[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4AF402B0.7090202@hartkopp.net>
Date: Fri, 06 Nov 2009 12:04:16 +0100
From: Oliver Hartkopp <socketcan@...tkopp.net>
To: Eric Dumazet <eric.dumazet@...il.com>
CC: "David S. Miller" <davem@...emloft.net>,
Linux Netdev List <netdev@...r.kernel.org>
Subject: Re: [PATCH] can: should not use __dev_get_by_index() without locks
Eric Dumazet wrote:
> David
>
> A more elegant patch will be possible for 2.6.33, but for 2.6.32,
> I think following patch is needed (Please note I did not test it)
>
> (More elegant : use RCU lookups ;) , I'll wait for net-next-2.6
> upgrade as well)
>
> Thanks
>
> [PATCH] can: should not use __dev_get_by_index() without locks
>
> bcm_proc_getifname() is called with RTNL and dev_base_lock
> not held. It calls __dev_get_by_index() without locks, and
> this is illegal (might crash)
>
> Close the race by holding dev_base_lock and copying dev->name
> in the protected section.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
Thanks for pointing this out.
This is a quite old code section which is not used very often at runtime - and
usually the netdevice is not removed at that time ;-)
Btw. this is no excuse for that missing locking, sorry.
Thanks for the fix!
Compiled and tested successfully.
Signed-off-by: Oliver Hartkopp <oliver@...tkopp.net>
--
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