From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf] netfilter: nat: fix crash when conntrack entry is re-used
Date: Thu, 24 Nov 2016 13:53:26 +0100 [thread overview]
Message-ID: <20161124125326.GB23970@salvia> (raw)
In-Reply-To: <1479859863-1067-1-git-send-email-fw@strlen.de>
On Wed, Nov 23, 2016 at 01:11:03AM +0100, Florian Westphal wrote:
> Stas Nichiporovich reports oops in nf_nat_bysource_cmp(), trying to
> access nf_conn struct at address 0xffffffffffffff50.
>
> This is the result of fetching a null rhash list (struct embedded at
> offset 176; 0 - 176 gets us ...fff50).
>
> The problem is that conntrack entries are allocated from a
> SLAB_DESTROY_BY_RCU cache, i.e. entries can be free'd and reused
> on another cpu while nf nat bysource hash access the same conntrack entry.
>
> Freeing is fine (we hold rcu read lock); zeroing rhlist_head isn't.
>
> -> Move the rhlist struct outside of the memset()-inited area.
Also applied, thanks.
prev parent reply other threads:[~2016-11-24 12:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-23 0:11 [PATCH nf] netfilter: nat: fix crash when conntrack entry is re-used Florian Westphal
2016-11-24 12:53 ` 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=20161124125326.GB23970@salvia \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--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).