l2tp: ensure session can't get removed during pppol2tp_session_ioctl()
authorGuillaume Nault <g.nault@alphalink.fr>
Fri, 31 Mar 2017 11:02:26 +0000 (13:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 2 Apr 2017 03:16:41 +0000 (20:16 -0700)
commit57377d63547861919ee634b845c7caa38de4a452
tree5e00b7be9f0d3abc3b0901662867aba202835c0a
parent61b9a047729bb230978178bca6729689d0c50ca2
l2tp: ensure session can't get removed during pppol2tp_session_ioctl()

Holding a reference on session is required before calling
pppol2tp_session_ioctl(). The session could get freed while processing the
ioctl otherwise. Since pppol2tp_session_ioctl() uses the session's socket,
we also need to take a reference on it in l2tp_session_get().

Fixes: fd558d186df2 ("l2tp: Split pppol2tp patch into separate l2tp and ppp parts")
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_ppp.c