From: Pablo Neira Ayuso <pablo@netfilter.org>
To: gfree.wind@foxmail.com
Cc: netfilter-devel@vger.kernel.org, Gao Feng <fgao@ikuai8.com>
Subject: Re: [PATCH nf v2] netfilter: cttimeout: Fix one possible use-after-free issue
Date: Fri, 14 Apr 2017 03:28:26 +0200 [thread overview]
Message-ID: <20170414012826.GA30669@salvia> (raw)
In-Reply-To: <1492132420-70400-1-git-send-email-gfree.wind@foxmail.com>
On Fri, Apr 14, 2017 at 09:13:40AM +0800, gfree.wind@foxmail.com wrote:
> From: Gao Feng <fgao@ikuai8.com>
>
> The function ctnl_untimeout is used to untimeout every conntrack
> which is using the timeout. But it is necessary to add one barrier
> synchronize_rcu because of racing. Maybe one conntrack has already
> owned this timeout, but it is not inserted into unconfirmed list or
> the hash list, when ctnl_untimeout untimeout the conntracks
>
> Let me describe it with a call path
> CPU1 CPU2
> alloc new conn
> add timeout ext
> ctnl_timeout_try_del
> untimeout all conns in list
> kfree_rcu.
> conn is confirmed.
Then this confirmed conn gets a timeout_ext->timeout == NULL since
ctnl_untimeout() is called first.
next prev parent reply other threads:[~2017-04-14 1:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-14 1:13 [PATCH nf v2] netfilter: cttimeout: Fix one possible use-after-free issue gfree.wind
2017-04-14 1:28 ` Pablo Neira Ayuso [this message]
2017-04-14 2:13 ` Gao Feng
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=20170414012826.GA30669@salvia \
--to=pablo@netfilter.org \
--cc=fgao@ikuai8.com \
--cc=gfree.wind@foxmail.com \
--cc=netfilter-devel@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).