netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guillaume Nault <gnault@redhat.com>
To: Shigeru Yoshida <syoshida@redhat.com>
Cc: jchapman@katalix.com, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, Cong Wang <cong.wang@bytedance.com>
Subject: Re: [PATCH net v3] l2tp: Avoid possible recursive deadlock in l2tp_tunnel_register()
Date: Fri, 17 Feb 2023 12:14:34 +0100	[thread overview]
Message-ID: <Y+9hmmAlHOo4yX9Q@debian> (raw)
In-Reply-To: <20230216163710.2508327-1-syoshida@redhat.com>

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>


  reply	other threads:[~2023-02-17 11:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-16 16:37 [PATCH net v3] l2tp: Avoid possible recursive deadlock in l2tp_tunnel_register() Shigeru Yoshida
2023-02-17 11:14 ` Guillaume Nault [this message]
2023-02-20  9:30 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y+9hmmAlHOo4yX9Q@debian \
    --to=gnault@redhat.com \
    --cc=cong.wang@bytedance.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jchapman@katalix.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=syoshida@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).