From: David Miller <davem@davemloft.net>
To: sd@queasysnail.net
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net] l2tp: fix use-after-free during module unload
Date: Thu, 01 Sep 2016 16:34:16 -0700 (PDT) [thread overview]
Message-ID: <20160901.163416.76744449780953103.davem@davemloft.net> (raw)
In-Reply-To: <f30d3c9f96a7de81af18061ac61a2d24ef179bf8.1472557704.git.sd@queasysnail.net>
From: Sabrina Dubroca <sd@queasysnail.net>
Date: Tue, 30 Aug 2016 16:05:16 +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_net_exit() 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>
Please resubmit this with Sergei's feedback addressed.
Thanks.
prev parent reply other threads:[~2016-09-01 23:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-30 14:05 [PATCH net] l2tp: fix use-after-free during module unload Sabrina Dubroca
2016-08-30 17:51 ` Sergei Shtylyov
2016-09-01 23:34 ` 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=20160901.163416.76744449780953103.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=sd@queasysnail.net \
/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).