l2tp: hold tunnel used while creating sessions with netlink
authorGuillaume Nault <g.nault@alphalink.fr>
Fri, 25 Aug 2017 14:51:46 +0000 (16:51 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Aug 2017 18:34:58 +0000 (11:34 -0700)
commite702c1204eb57788ef189c839c8c779368267d70
treeef7cfae25bf1b386f03c5dfb8c44266083d0c53b
parent4e4b21da3acc68a7ea55f850cacc13706b7480e9
l2tp: hold tunnel used while creating sessions with netlink

Use l2tp_tunnel_get() to retrieve tunnel, so that it can't go away on
us. Otherwise l2tp_tunnel_destruct() might release the last reference
count concurrently, thus freeing the tunnel while we're using it.

Fixes: 309795f4bec2 ("l2tp: Add netlink control API for L2TP")
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_netlink.c