[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B43BEFF.3030401@gmail.com>
Date: Tue, 05 Jan 2010 23:36:47 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: Flavio Leitner <fleitner@...hat.com>
CC: netdev@...r.kernel.org, David Miller <davem@...emloft.net>,
David Stevens <dlstevens@...ibm.com>
Subject: Re: [PATCH] igmp: fix ip_mc_sf_allow race [v3]
Le 05/01/2010 21:52, Flavio Leitner a écrit :
> Almost all igmp functions accessing inet->mc_list are protected by
> rtnl_lock(), but there is one exception which is ip_mc_sf_allow(),
> so there is a chance of either ip_mc_drop_socket or ip_mc_leave_group
> remove an entry while ip_mc_sf_allow is running causing a crash.
>
> Signed-off-by: Flavio Leitner <fleitner@...hat.com>
Acked-by: Eric Dumazet <eric.dumazet@...il.com>
Small notes : in ip_mc_drop_socket()
// rcu_read_lock()/unlock() seems not really needed here, we only want to avoid
//the fill rtnlçlock() in case this socket have a NULL mc_list.
rcu_read_lock();
if (rcu_dereference(inet->mc_list) == NULL) {
rcu_read_unlock();
return;
}
rcu_read_unlock();
rtnl_lock();
while ((iml = rcu_dereference(inet->mc_list)) != NULL) {
rcu_dereference() is not really needed here, since you own RTNL
--
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