netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: sd@queasysnail.net
Cc: netdev@vger.kernel.org, sergei.shtylyov@cogentembedded.com
Subject: Re: [PATCH net v2] l2tp: fix use-after-free during module unload
Date: Fri, 02 Sep 2016 11:45:10 -0700 (PDT)	[thread overview]
Message-ID: <20160902.114510.2079683210993243165.davem@davemloft.net> (raw)
In-Reply-To: <996e12b7faf7fd20ba9c0c76614fd5bb4a3d70c4.1472804437.git.sd@queasysnail.net>

From: Sabrina Dubroca <sd@queasysnail.net>
Date: Fri,  2 Sep 2016 10:22:54 +0200

> Tunnel deletion is delayed by both a workqueue (l2tp_tunnel_delete -> wq
>  -> l2tp_tunnel_del_work) and RCU (sk_destruct -> RCU ->
> l2tp_tunnel_destruct).
> 
> By the time l2tp_tunnel_destruct() runs to destroy the tunnel and finish
> destroying the socket, the private data reserved via the net_generic
> mechanism has already been freed, but l2tp_tunnel_destruct() actually
> uses this data.
> 
> Make sure tunnel deletion for the netns has completed before returning
> from l2tp_exit_net() by first flushing the tunnel removal workqueue, and
> then waiting for RCU callbacks to complete.
> 
> Fixes: 167eb17e0b17 ("l2tp: create tunnel sockets in the right namespace")
> Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
> ---
> v2: fix typo in commit message, spotted by Sergei Shtylyov

Applied.

      reply	other threads:[~2016-09-02 18:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02  8:22 [PATCH net v2] l2tp: fix use-after-free during module unload Sabrina Dubroca
2016-09-02 18:45 ` David Miller [this message]

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=20160902.114510.2079683210993243165.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=sd@queasysnail.net \
    --cc=sergei.shtylyov@cogentembedded.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).