From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Xin Long <lucien.xin@gmail.com>
Cc: Sabrina Dubroca <sd@queasysnail.net>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf] netfilter: ipt_CLUSTERIP: fix use-after-free of proc entry
Date: Wed, 19 Jul 2017 11:52:05 +0200 [thread overview]
Message-ID: <20170719095205.GA1057@salvia> (raw)
In-Reply-To: <CADvbK_f8Ya17-nmXLatEqEXFU6+bo=nOjFW1yn8oZcRGYG5u8Q@mail.gmail.com>
On Wed, Jul 19, 2017 at 12:29:58PM +1200, Xin Long wrote:
> On Wed, Jul 19, 2017 at 12:56 AM, Sabrina Dubroca <sd@queasysnail.net> wrote:
> > When we delete a netns with a CLUSTERIP rule, clusterip_net_exit() is
> > called first, removing /proc/net/ipt_CLUSTERIP.
> > Then clusterip_config_entry_put() is called from clusterip_tg_destroy(),
> > and tries to remove its entry under /proc/net/ipt_CLUSTERIP/.
> >
> > Fix this by checking that the parent directory of the entry to remove
> > hasn't already been deleted.
> >
> > The following triggers a KASAN splat (stealing the reproducer from
> > 202f59afd441, thanks to Jianlin Shi and Xin Long):
> >
> > ip netns add test
> > ip link add veth0_in type veth peer name veth0_out
> > ip link set veth0_in netns test
> > ip netns exec test ip link set lo up
> > ip netns exec test ip link set veth0_in up
> > ip netns exec test iptables -I INPUT -d 1.2.3.4 -i veth0_in -j \
> > CLUSTERIP --new --clustermac 89:d4:47:eb:9a:fa --total-nodes 3 \
> > --local-node 1 --hashmode sourceip-sourceport
> > ip netns del test
> >
> > Fixes: ce4ff76c15a8 ("netfilter: ipt_CLUSTERIP: make proc directory per net namespace")
> > Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
>
> Reviewed-by: Xin Long <lucien.xin@gmail.com>
Applied, thanks.
prev parent reply other threads:[~2017-07-19 9:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-18 12:56 [PATCH nf] netfilter: ipt_CLUSTERIP: fix use-after-free of proc entry Sabrina Dubroca
2017-07-19 0:29 ` Xin Long
2017-07-19 9:52 ` Pablo Neira Ayuso [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=20170719095205.GA1057@salvia \
--to=pablo@netfilter.org \
--cc=lucien.xin@gmail.com \
--cc=netfilter-devel@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).