lkml.org 
[lkml]   [2023]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net v3] l2tp: Avoid possible recursive deadlock in l2tp_tunnel_register()
On Fri, Feb 17, 2023 at 01:37:10AM +0900, Shigeru Yoshida wrote:
> @@ -840,8 +850,7 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
> }
> if (drop_refcnt)
> l2tp_session_dec_refcount(session);
> - if (drop_tunnel)
> - l2tp_tunnel_dec_refcount(tunnel);
> + l2tp_tunnel_dec_refcount(tunnel);
> release_sock(sk);
>
> return error;

The l2tp_tunnel_dec_refcount() call could be done after release_sock(),
to make the code more logical (as the refcount is now taken before
lock_sock()). Anyway, that shouldn't be a problem and I don't want to
delay this fix any longer.

Reviewed-by: Guillaume Nault <gnault@redhat.com>

\
 
 \ /
  Last update: 2023-03-27 00:26    [W:0.076 / U:0.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site