android_kernel_sony_sdm845/net/l2tp
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Guillaume Nault 8aeff20676 l2tp: ensure sessions are freed after their PPPOL2TP socket
commit cdd10c9627496ad25c87ce6394e29752253c69d3 upstream.

If l2tp_tunnel_delete() or l2tp_tunnel_closeall() deletes a session
right after pppol2tp_release() orphaned its socket, then the 'sock'
variable of the pppol2tp_session_close() callback is NULL. Yet the
session is still used by pppol2tp_release().

Therefore we need to take an extra reference in any case, to prevent
l2tp_tunnel_delete() or l2tp_tunnel_closeall() from freeing the session.

Since the pppol2tp_session_close() callback is only set if the session
is associated to a PPPOL2TP socket and that both l2tp_tunnel_delete()
and l2tp_tunnel_closeall() hold the PPPOL2TP socket before calling
pppol2tp_session_close(), we're sure that pppol2tp_session_close() and
pppol2tp_session_destruct() are paired and called in the right order.
So the reference taken by the former will be released by the later.

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 10:32:50 +02:00
..
Kconfig l2tp: Call udp_sock_create 2014-07-14 16:12:15 -07:00
l2tp_core.c l2tp: Fix possible NULL pointer dereference 2020-01-29 10:24:23 +01:00
l2tp_core.h l2tp: fix reading optional fields of L2TPv3 2019-02-06 17:33:27 +01:00
l2tp_debugfs.c l2tp: remove configurable payload offset 2018-11-10 07:42:54 -08:00
l2tp_eth.c l2tp: fix duplicate session creation 2017-07-05 14:40:18 +02:00
l2tp_ip.c l2tp: don't use l2tp_tunnel_find() in l2tp_ip and l2tp_ip6 2019-11-28 18:29:03 +01:00
l2tp_ip6.c l2tp: don't use l2tp_tunnel_find() in l2tp_ip and l2tp_ip6 2019-11-28 18:29:03 +01:00
l2tp_netlink.c l2tp: remove configurable payload offset 2018-11-10 07:42:54 -08:00
l2tp_ppp.c l2tp: ensure sessions are freed after their PPPOL2TP socket 2020-04-13 10:32:50 +02:00
Makefile l2tp: introduce L2TPv3 IP encapsulation support for IPv6 2012-05-01 09:30:55 -04:00