diff options
| author | Guillaume Nault <g.nault@alphalink.fr> | 2020-05-22 00:57:32 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-27 16:40:31 +0200 |
| commit | 57cf7aa66fb7b3ec4a3c5f31c996944233addcba (patch) | |
| tree | 9b259b7fc73842cca379b986c300ed0b6e897dc3 /kernel/sysctl_binary.c | |
| parent | eb34471f73dafc9cda27226cdf3fbafde5f04470 (diff) | |
l2tp: hold tunnel while handling genl TUNNEL_GET commands
commit 4e4b21da3acc68a7ea55f850cacc13706b7480e9 upstream.
Use l2tp_tunnel_get() instead of l2tp_tunnel_find() so that we get
a reference on the tunnel, preventing l2tp_tunnel_destruct() from
freeing it from under us.
Also move l2tp_tunnel_get() below nlmsg_new() so that we only take
the reference when needed.
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>
Signed-off-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/sysctl_binary.c')
0 files changed, 0 insertions, 0 deletions
