LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.hengli.com.au>
To: Jesper Juhl <jj@chaosbits.net>
Cc: linux-crypto@vger.kernel.org, tadeusz.struk@intel.com,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"David S. Miller" <davem@davemloft.net>,
	Huang Ying <ying.huang@intel.com>,
	Adrian Hoban <adrian.hoban@intel.com>,
	Gabriele Paoloni <gabriele.paoloni@intel.com>,
	aidan.o.mahony@intel.com
Subject: Re: [PATCH] rfc4106, Intel, AES-NI: Don't leak memory in rfc4106_set_hash_subkey().
Date: Sun, 23 Jan 2011 18:56:46 +1100	[thread overview]
Message-ID: <20110123075646.GA19175@gondor.apana.org.au> (raw)
In-Reply-To: <alpine.LNX.2.00.1101161527440.8049@swampdragon.chaosbits.net>

On Sun, Jan 16, 2011 at 03:38:47PM +0100, Jesper Juhl wrote:
> There's a small memory leak in 
> arch/x86/crypto/aesni-intel_glue.c::rfc4106_set_hash_subkey(). If the call 
> to kmalloc() fails and returns NULL then the memory allocated previously 
> by ablkcipher_request_alloc() is not freed when we leave the function.
> 
> I could have just added a call to ablkcipher_request_free() before we 
> return -ENOMEM, but that started to look too much like the code we 
> already had at the end of the function, so I chose instead to rework the 
> code a bit so that there are now a few labels at the end that we goto when 
> various allocations fail, so we don't have to repeat the same blocks of 
> code (this also reduces the object code size slightly).
> 
> Please review and consider merging.
> 
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>

Patch applied.  Thanks a lot!
-- 
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

  parent reply	other threads:[~2011-01-23  7:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-16 14:38 Jesper Juhl
2011-01-19 16:02 ` Struk, Tadeusz
2011-02-06 19:43   ` Jesper Juhl
2011-02-06 20:34     ` Herbert Xu
2011-02-06 20:34       ` Jesper Juhl
2011-02-06 20:48         ` Herbert Xu
2011-02-06 21:33           ` Jesper Juhl
2011-01-23  7:56 ` Herbert Xu [this message]
2011-02-07 17:32 tadeusz.struk
2011-02-07 18:24 ` Jesper Juhl
2011-02-11 14:26   ` Pavel Machek
2011-02-11 14:38     ` Paoloni, Gabriele
2011-02-11 14:47       ` Jesper Juhl
2011-02-07 21:09 ` Herbert Xu
2011-02-10 18:47   ` Jesper Juhl
2011-02-08  8:59 tadeusz.struk

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=20110123075646.GA19175@gondor.apana.org.au \
    --to=herbert@gondor.hengli.com.au \
    --cc=adrian.hoban@intel.com \
    --cc=aidan.o.mahony@intel.com \
    --cc=davem@davemloft.net \
    --cc=gabriele.paoloni@intel.com \
    --cc=hpa@zytor.com \
    --cc=jj@chaosbits.net \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tadeusz.struk@intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=ying.huang@intel.com \
    --subject='Re: [PATCH] rfc4106, Intel, AES-NI: Don'\''t leak memory in rfc4106_set_hash_subkey().' \
    /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

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).