]> git.baikalelectronics.ru Git - kernel.git/commit
l2tp: fix race in duplicate tunnel detection
authorGuillaume Nault <g.nault@alphalink.fr>
Tue, 10 Apr 2018 19:01:13 +0000 (21:01 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Apr 2018 21:41:27 +0000 (17:41 -0400)
commit150630e3cf5d954741340bb6850a7c8f4c09ce0d
treef616d85bc1fa0339fc227d4672cea1f4b4042a30
parent97c1278b1b99335305e797814d3d8e4fd7bcfced
l2tp: fix race in duplicate tunnel detection

We can't use l2tp_tunnel_find() to prevent l2tp_nl_cmd_tunnel_create()
from creating a duplicate tunnel. A tunnel can be concurrently
registered after l2tp_tunnel_find() returns. Therefore, searching for
duplicates must be done at registration time.

Finally, remove l2tp_tunnel_find() entirely as it isn't use anywhere
anymore.

Fixes: 654563a37b6e ("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_core.c
net/l2tp/l2tp_core.h
net/l2tp/l2tp_netlink.c