summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2017-09-22 15:39:23 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-13 10:32:50 +0200
commit8aeff206767ea83d5b36746e03a4dfc9cec8a6b2 (patch)
treebba7533b90987c0f6ffca0a5f09d63d29a6d18c7 /drivers/gpu
parenta5ad06fc4b7b22f6df0c21b7052a82e039305a14 (diff)
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>
Diffstat (limited to 'drivers/gpu')
0 files changed, 0 insertions, 0 deletions