diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2017-09-22 15:39:23 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-09-25 14:44:41 -0700 |
commit | cdd10c9627496ad25c87ce6394e29752253c69d3 (patch) | |
tree | 98e157d68334d1e93dd530a9167526952b6b779f /kernel/watchdog.c | |
parent | 5c346525d3591cb032eca86d0f904cc01f1069ff (diff) | |
download | linux-cdd10c9627496ad25c87ce6394e29752253c69d3.tar.bz2 |
l2tp: ensure sessions are freed after their PPPOL2TP socket
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>
Diffstat (limited to 'kernel/watchdog.c')
0 files changed, 0 insertions, 0 deletions