]> git.baikalelectronics.ru Git - kernel.git/commit
[IPV6]: ipv6_add_addr should install dstentry earlier
authorKeir Fraser <keir.fraser@cl.cam.ac.uk>
Tue, 29 Aug 2006 09:43:49 +0000 (02:43 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 30 Aug 2006 04:22:18 +0000 (21:22 -0700)
commit586883231b0eb3c2fdd9847bcd3075bbbaa1c5c7
treec47651ea2300b28e11d6898f67f73eab41a9423b
parent553dec9c0b74bdf3f3f4255d6e4831a8dbebbac4
[IPV6]: ipv6_add_addr should install dstentry earlier

ipv6_add_addr allocates a struct inet6_ifaddr and a dstentry, but it
doesn't install the dstentry in ifa->rt until after it releases the
addrconf_hash_lock. This means other CPUs will be able to see the new
address while it hasn't been initialized completely yet.

One possible fix would be to grab the ifp->lock spinlock when
creating the address struct; a simpler fix is to just move the
assignment.

Acked-by: jbeulich@novell.com
Acked-by: okir@suse.de
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/addrconf.c