netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: g.nault@alphalink.fr
Cc: netdev@vger.kernel.org, jchapman@katalix.com
Subject: Re: [PATCH net] l2tp: fix refcount leakage on PPPoL2TP sockets
Date: Tue, 05 Jun 2018 09:41:24 -0400 (EDT)	[thread overview]
Message-ID: <20180605.094124.1023096251110931871.davem@davemloft.net> (raw)
In-Reply-To: <6021bb159fc069256f8947622e4b180d234fea0a.1528129907.git.g.nault@alphalink.fr>

From: Guillaume Nault <g.nault@alphalink.fr>
Date: Mon, 4 Jun 2018 18:52:19 +0200

> Commit d02ba2a6110c ("l2tp: fix race in pppol2tp_release with session
> object destroy") tried to fix a race condition where a PPPoL2TP socket
> would disappear while the L2TP session was still using it. However, it
> missed the root issue which is that an L2TP session may accept to be
> reconnected if its associated socket has entered the release process.
> 
> The tentative fix makes the session hold the socket it is connected to.
> That saves the kernel from crashing, but introduces refcount leakage,
> preventing the socket from completing the release process. Once stalled,
> everything the socket depends on can't be released anymore, including
> the L2TP session and the l2tp_ppp module.
 ...
> So it all boils down to pppol2tp_connect() failing to realise that the
> session has already been connected. This patch drops the unneeded extra
> reference counting (mostly reverting d02ba2a6110c) and checks that
> neither ->sk nor ->__sk is set before allowing a session to be
> connected.
> 
> Fixes: d02ba2a6110c ("l2tp: fix race in pppol2tp_release with session object destroy")
> Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>

So much fidgeting around in this area over the past year or two :-)

Applied and queued up for -stable, thanks for fixing this.

  reply	other threads:[~2018-06-05 13:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-04 16:52 [PATCH net] l2tp: fix refcount leakage on PPPoL2TP sockets Guillaume Nault
2018-06-05 13:41 ` David Miller [this message]
2018-06-05 16:37   ` Guillaume Nault

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=20180605.094124.1023096251110931871.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=g.nault@alphalink.fr \
    --cc=jchapman@katalix.com \
    --cc=netdev@vger.kernel.org \
    /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).