* [PATCH] CRYPTO: ablkcipher, avoid NULL dereference @ 2010-06-21 15:01 Jiri Slaby 2010-06-21 20:44 ` David Miller 0 siblings, 1 reply; 3+ messages in thread From: Jiri Slaby @ 2010-06-21 15:01 UTC (permalink / raw) To: herbert; +Cc: linux-kernel, jirislaby, David S. Miller Stanse found a potential NULL dereference in ablkcipher_next_slow. Even though kmalloc fails, its retval is dereferenced later. Return from that function properly earlier. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: David S. Miller <davem@davemloft.net> Cc: Herbert Xu <herbert@gondor.apana.org.au> --- crypto/ablkcipher.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c index 98a6610..a854df2 100644 --- a/crypto/ablkcipher.c +++ b/crypto/ablkcipher.c @@ -165,7 +165,7 @@ static inline int ablkcipher_next_slow(struct ablkcipher_request *req, p = kmalloc(n, GFP_ATOMIC); if (!p) - ablkcipher_walk_done(req, walk, -ENOMEM); + return ablkcipher_walk_done(req, walk, -ENOMEM); base = p + 1; -- 1.7.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] CRYPTO: ablkcipher, avoid NULL dereference 2010-06-21 15:01 [PATCH] CRYPTO: ablkcipher, avoid NULL dereference Jiri Slaby @ 2010-06-21 20:44 ` David Miller 2010-06-23 10:01 ` Herbert Xu 0 siblings, 1 reply; 3+ messages in thread From: David Miller @ 2010-06-21 20:44 UTC (permalink / raw) To: jslaby; +Cc: herbert, linux-kernel, jirislaby From: Jiri Slaby <jslaby@suse.cz> Date: Mon, 21 Jun 2010 17:01:23 +0200 > Stanse found a potential NULL dereference in ablkcipher_next_slow. > Even though kmalloc fails, its retval is dereferenced later. Return > from that function properly earlier. > > Signed-off-by: Jiri Slaby <jslaby@suse.cz> Thanks for fixing this: Acked-by: David S. Miller <davem@davemloft.net> ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] CRYPTO: ablkcipher, avoid NULL dereference 2010-06-21 20:44 ` David Miller @ 2010-06-23 10:01 ` Herbert Xu 0 siblings, 0 replies; 3+ messages in thread From: Herbert Xu @ 2010-06-23 10:01 UTC (permalink / raw) To: David Miller; +Cc: jslaby, linux-kernel, jirislaby On Mon, Jun 21, 2010 at 01:44:52PM -0700, David Miller wrote: > From: Jiri Slaby <jslaby@suse.cz> > Date: Mon, 21 Jun 2010 17:01:23 +0200 > > > Stanse found a potential NULL dereference in ablkcipher_next_slow. > > Even though kmalloc fails, its retval is dereferenced later. Return > > from that function properly earlier. > > > > Signed-off-by: Jiri Slaby <jslaby@suse.cz> > > Thanks for fixing this: > > Acked-by: David S. Miller <davem@davemloft.net> Patch applied to crypt-2.6. Thanks! -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-06-23 10:02 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-06-21 15:01 [PATCH] CRYPTO: ablkcipher, avoid NULL dereference Jiri Slaby 2010-06-21 20:44 ` David Miller 2010-06-23 10:01 ` Herbert Xu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®