diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2018-04-10 21:01:13 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-11 17:41:27 -0400 |
commit | f6cd651b056ffd3b4e8496afd44d4ed44bf69136 (patch) | |
tree | f616d85bc1fa0339fc227d4672cea1f4b4042a30 /net/l2tp/l2tp_core.h | |
parent | 6b9f34239b00e6956a267abed2bc559ede556ad6 (diff) | |
download | linux-f6cd651b056ffd3b4e8496afd44d4ed44bf69136.tar.bz2 |
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: 309795f4bec2 ("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>
Diffstat (limited to 'net/l2tp/l2tp_core.h')
-rw-r--r-- | net/l2tp/l2tp_core.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/net/l2tp/l2tp_core.h b/net/l2tp/l2tp_core.h index 12f0fa82f162..ba33cbec71eb 100644 --- a/net/l2tp/l2tp_core.h +++ b/net/l2tp/l2tp_core.h @@ -220,7 +220,6 @@ struct l2tp_session *l2tp_session_get(const struct net *net, struct l2tp_session *l2tp_session_get_nth(struct l2tp_tunnel *tunnel, int nth); struct l2tp_session *l2tp_session_get_by_ifname(const struct net *net, const char *ifname); -struct l2tp_tunnel *l2tp_tunnel_find(const struct net *net, u32 tunnel_id); struct l2tp_tunnel *l2tp_tunnel_find_nth(const struct net *net, int nth); int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, |