LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jesper Juhl <jj@chaosbits.net>
To: Herbert Xu <herbert@gondor.hengli.com.au>
Cc: "Struk, Tadeusz" <tadeusz.struk@intel.com>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"x86@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>,
	"Hoban, Adrian" <adrian.hoban@intel.com>,
	"Paoloni, Gabriele" <gabriele.paoloni@intel.com>,
	"O Mahony, Aidan" <aidan.o.mahony@intel.com>
Subject: Re: [PATCH] rfc4106, Intel, AES-NI: Don't leak memory in rfc4106_set_hash_subkey().
Date: Sun, 6 Feb 2011 22:33:31 +0100 (CET)	[thread overview]
Message-ID: <alpine.LNX.2.00.1102062231530.13593@swampdragon.chaosbits.net> (raw)
In-Reply-To: <20110206204829.GA12652@gondor.apana.org.au>

On Mon, 7 Feb 2011, Herbert Xu wrote:

> On Sun, Feb 06, 2011 at 09:34:33PM +0100, Jesper Juhl wrote:
> > On Mon, 7 Feb 2011, Herbert Xu wrote:
> > 
> > > On Sun, Feb 06, 2011 at 08:43:22PM +0100, Jesper Juhl wrote:
> > > > 
> > > > Herbert: If Tadeusz agrees, could you please replace the patch you merged 
> > > > with the one above?
> > > 
> > > Please send an incremental patch.
> > > 
> > Sure thing. What would you like it based on exactly?
> 
> The current cryptodev-2.6 tree should do.
> 
Here goes.

Fix up previous patch that attempted to fix a mem leak in 
rfc4106_set_hash_subkey. The previous patch was flawed in that the 'goto 
out' would still leak.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 aesni-intel_glue.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c
index e013552..4a8c015 100644
--- a/arch/x86/crypto/aesni-intel_glue.c
+++ b/arch/x86/crypto/aesni-intel_glue.c
@@ -874,7 +874,7 @@ rfc4106_set_hash_subkey(u8 *hash_subkey, const u8 *key, unsigned int key_len)
 
 	ret = crypto_ablkcipher_setkey(ctr_tfm, key, key_len);
 	if (ret)
-		goto out;
+		goto out_free_ablkcipher;
 
 	req = ablkcipher_request_alloc(ctr_tfm, GFP_KERNEL);
 	if (!req) {
@@ -916,7 +916,6 @@ out_free_request:
 	kfree(req_data);
 out_free_ablkcipher:
 	crypto_free_ablkcipher(ctr_tfm);
-out:
 	return ret;
 }
 
 

-- 
Jesper Juhl <jj@chaosbits.net>            http://www.chaosbits.net/
Plain text mails only, please.
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html


  reply	other threads:[~2011-02-06 21:34 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 [this message]
2011-01-23  7:56 ` Herbert Xu
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=alpine.LNX.2.00.1102062231530.13593@swampdragon.chaosbits.net \
    --to=jj@chaosbits.net \
    --cc=adrian.hoban@intel.com \
    --cc=aidan.o.mahony@intel.com \
    --cc=davem@davemloft.net \
    --cc=gabriele.paoloni@intel.com \
    --cc=herbert@gondor.hengli.com.au \
    --cc=hpa@zytor.com \
    --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).