]> git.baikalelectronics.ru Git - kernel.git/commit
l2tp: prevent pppol2tp_connect() from creating kernel sockets
authorGuillaume Nault <g.nault@alphalink.fr>
Wed, 13 Jun 2018 13:09:20 +0000 (15:09 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Jun 2018 00:10:19 +0000 (17:10 -0700)
commit6fa6c15dc724722f0eba824c40c7607dec5a2c66
tree5de6f40851edb8e21f64c182698b3b928db1b8c5
parent6378a786731a27d4c79b8f31e0a106c1f7b5fe69
l2tp: prevent pppol2tp_connect() from creating kernel sockets

If 'fd' is negative, l2tp_tunnel_create() creates a tunnel socket using
the configuration passed in 'tcfg'. Currently, pppol2tp_connect() sets
the relevant fields to zero, tricking l2tp_tunnel_create() into setting
up an unusable kernel socket.

We can't set 'tcfg' with the required fields because there's no way to
get them from the current connect() parameters. So let's restrict
kernel sockets creation to the netlink API, which is the original use
case.

Fixes: 7ecc1f0da88f ("l2tp: Add support for static unmanaged L2TPv3 tunnels")
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_ppp.c