l2tp: fix a race in l2tp_ip_sendmsg()
authorEric Dumazet <edumazet@google.com>
Fri, 8 Jun 2012 06:25:00 +0000 (06:25 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Jul 2012 16:03:45 +0000 (09:03 -0700)
commit4ffa79bd261281152345b55d77da1709d1afdf3c
treecd93ad75f519f171b279e44b2c19d247c22d7fb5
parentb133be60ddab3b700ec1e516cc6ec5aac20770e0
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/l2tp/l2tp_ip.c