diff options
author | Sebastian Siewior <sebastian@breakpoint.cc> | 2007-08-03 08:33:47 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2007-08-06 03:33:56 -0400 |
commit | 06817176784f620984200dc5d7cbe16984f7b262 (patch) | |
tree | 42de1788711cff6832c99a4f6a6518bb4f316935 /crypto/blkcipher.c | |
parent | d4ac2477fad0f2680e84ec12e387ce67682c5c13 (diff) |
[CRYPTO] api: fix writting into unallocated memory in setkey_aligned
setkey_unaligned() commited in ca7c39385ce1a7b44894a4b225a4608624e90730
overwrites unallocated memory in the following memset() because
I used the wrong buffer length.
Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/blkcipher.c')
-rw-r--r-- | crypto/blkcipher.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c index 40a3dcff15bb..7755834b8846 100644 --- a/crypto/blkcipher.c +++ b/crypto/blkcipher.c | |||
@@ -352,7 +352,7 @@ static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, unsigned int | |||
352 | alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); | 352 | alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); |
353 | memcpy(alignbuffer, key, keylen); | 353 | memcpy(alignbuffer, key, keylen); |
354 | ret = cipher->setkey(tfm, alignbuffer, keylen); | 354 | ret = cipher->setkey(tfm, alignbuffer, keylen); |
355 | memset(alignbuffer, 0, absize); | 355 | memset(alignbuffer, 0, keylen); |
356 | kfree(buffer); | 356 | kfree(buffer); |
357 | return ret; | 357 | return ret; |
358 | } | 358 | } |