l2tp: filter out non-PPP sessions in pppol2tp_tunnel_ioctl()
authorGuillaume Nault <g.nault@alphalink.fr>
Fri, 15 Jun 2018 13:39:19 +0000 (15:39 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Jun 2018 16:12:37 +0000 (09:12 -0700)
commitecd012e45ab5fd76ed57546865897ce35920f56b
tree12d71dfe6a8eb01abc6b27ac4ba262a33387f291
parentde9bada5d389903f4faf33980e6a95a2911c7e6d
l2tp: filter out non-PPP sessions in pppol2tp_tunnel_ioctl()

pppol2tp_tunnel_ioctl() can act on an L2TPv3 tunnel, in which case
'session' may be an Ethernet pseudo-wire.

However, pppol2tp_session_ioctl() expects a PPP pseudo-wire, as it
assumes l2tp_session_priv() points to a pppol2tp_session structure. For
an Ethernet pseudo-wire l2tp_session_priv() points to an l2tp_eth_sess
structure instead, making pppol2tp_session_ioctl() access invalid
memory.

Fixes: d9e31d17ceba ("l2tp: Add L2TP ethernet pseudowire support")
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_ppp.c