l2tp: initialise session's refcount before making it reachable
authorGuillaume Nault <g.nault@alphalink.fr>
Fri, 25 Aug 2017 14:22:17 +0000 (16:22 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Aug 2017 18:28:33 +0000 (11:28 -0700)
commit9ee369a405c57613d7c83a3967780c3e30c52ecc
tree9b11954e5446349cf84b7d1eedcf939fe74bb5f1
parent4c22868264516fe0c42817a87f37efb44254e7a9
l2tp: initialise session's refcount before making it reachable

Sessions must be fully initialised before calling
l2tp_session_add_to_tunnel(). Otherwise, there's a short time frame
where partially initialised sessions can be accessed by external users.

Fixes: dbdbc73b4478 ("l2tp: fix duplicate session creation")
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_core.c