l2tp: fix a race in l2tp_ip_sendmsg()
authorEric Dumazet <edumazet@google.com>
Fri, 8 Jun 2012 06:25:00 +0000 (06:25 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 12 Jul 2012 03:32:13 +0000 (04:32 +0100)
commit5b73845cd7629c3b944542999b8e69989a4dd70e
tree6861d6bcecbca187fc142cc46eba925d871d3fa3
parent43f06c88b9293b6bfb5724757c0c9e7d9e2b2103
l2tp: fix a race in l2tp_ip_sendmsg()

[ Upstream commit 4399a4df98a63e30fd16e9d0cecc46ea92269e8f ]

Commit 081b1b1bb27f (l2tp: fix l2tp_ip_sendmsg() route handling) added
a race, in case IP route cache is disabled.

In this case, we should not do the dst_release(&rt->dst), since it'll
free the dst immediately, instead of waiting a RCU grace period.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: James Chapman <jchapman@katalix.com>
Cc: Denys Fedoryshchenko <denys@visp.net.lb>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/l2tp/l2tp_ip.c