]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
tunnels: Fix tunnels change rcu protection
authorPavel Emelyanov <xemul@parallels.com>
Wed, 27 Oct 2010 05:43:53 +0000 (05:43 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 Oct 2010 21:20:08 +0000 (14:20 -0700)
commit74b0b85b88aaa952023762e0280799aaae849841
treea3049c0efd6332785e2323581506c89d49c67538
parent1933f0c09438ed8ccfee2281b814d9b26cef336c
tunnels: Fix tunnels change rcu protection

After making rcu protection for tunnels (ipip, gre, sit and ip6) a bug
was introduced into the SIOCCHGTUNNEL code.

The tunnel is first unlinked, then addresses change, then it is linked
back probably into another bucket. But while changing the parms, the
hash table is unlocked to readers and they can lookup the improper tunnel.

Respective commits are b7285b79 (ipip: get rid of ipip_lock), 1507850b
(gre: get rid of ipgre_lock), 3a43be3c (sit: get rid of ipip6_lock) and
94767632 (ip6tnl: get rid of ip6_tnl_lock).

The quick fix is to wait for quiescent state to pass after unlinking,
but if it is inappropriate I can invent something better, just let me
know.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_gre.c
net/ipv4/ipip.c
net/ipv6/ip6_tunnel.c
net/ipv6/sit.c