All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Tobias Brunner <tobias@strongswan.org>
Cc: Steffen Klassert <steffen.klassert@secunet.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org,
	Christophe Gouault <christophe.gouault@6wind.com>
Subject: Re: [PATCH ipsec] xfrm: Ignore socket policies when rebuilding hash tables
Date: Fri, 29 Jul 2016 16:19:11 +0800	[thread overview]
Message-ID: <20160729081911.GC11307@gondor.apana.org.au> (raw)
In-Reply-To: <8e6b1395-6f17-66ce-e257-6b6073ca7103@strongswan.org>

On Fri, Jul 29, 2016 at 09:57:32AM +0200, Tobias Brunner wrote:
> Whenever thresholds are changed the hash tables are rebuilt.  This is
> done by enumerating all policies and hashing and inserting them into
> the right table according to the thresholds and direction.
> 
> Because socket policies are also contained in net->xfrm.policy_all but
> no hash tables are defined for their direction (dir + XFRM_POLICY_MAX)
> this causes a NULL or invalid pointer dereference after returning from
> policy_hash_bysel() if the rebuild is done while any socket policies
> are installed.
> 
> Since the rebuild after changing thresholds is scheduled this crash
> could even occur if the userland sets thresholds seemingly before
> installing any socket policies.
> 
> Fixes: 53c2e285f970 ("xfrm: Do not hash socket policies")
> Signed-off-by: Tobias Brunner <tobias@strongswan.org>

Acked-by: Herbert Xu <herbert@gondor.apana.org.au>

Good catch, thanks!
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2016-07-29  8:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-29  7:57 [PATCH ipsec] xfrm: Ignore socket policies when rebuilding hash tables Tobias Brunner
2016-07-29  8:19 ` Herbert Xu [this message]
2016-07-29 10:40   ` Steffen Klassert

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=20160729081911.GC11307@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=christophe.gouault@6wind.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    --cc=tobias@strongswan.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.