All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Pan Bian <bianpan2016@163.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Pan Bian <bianpan2013@163.com>,
	Mathias Krause <minipli@googlemail.com>
Subject: Re: [net] xfrm_user: use xfrm_state_put to free xfrm_state_alloc return value
Date: Wed, 21 Nov 2018 16:00:45 +0800	[thread overview]
Message-ID: <20181121080045.4vtozqc6eyeyis2n@gondor.apana.org.au> (raw)
In-Reply-To: <1542783468-67482-1-git-send-email-bianpan2016@163.com>

On Wed, Nov 21, 2018 at 02:57:48PM +0800, Pan Bian wrote:
> From: Pan Bian <bianpan2013@163.com>
> 
> The memory chunk allocated by xfrm_state_alloc() should be released with
> xfrm_state_put(), not kfree.
> 
> Signed-off-by: Pan Bian <bianpan2013@163.com>

This bug was introduced by

	commit 565f0fa902b64020d5d147ff1708567e9e0b6e49
	Author: Mathias Krause <minipli@googlemail.com>
	Date:   Thu May 3 10:55:07 2018 +0200

While using xfrm_state_put may work it's certainly not the designed
to do this.  We should instead export a function that calls
kmem_cache_free on xfrm_state directly and use that here.

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:[~2018-11-21  8:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-21  6:57 [net] xfrm_user: use xfrm_state_put to free xfrm_state_alloc return value Pan Bian
2018-11-21  8:00 ` Herbert Xu [this message]
2018-11-21 20:09   ` Mathias Krause
2018-11-22 14:43     ` Herbert Xu
2018-11-27  7:55       ` 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=20181121080045.4vtozqc6eyeyis2n@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=bianpan2013@163.com \
    --cc=bianpan2016@163.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minipli@googlemail.com \
    --cc=netdev@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    /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.