From 06817176784f620984200dc5d7cbe16984f7b262 Mon Sep 17 00:00:00 2001 From: Sebastian Siewior Date: Fri, 3 Aug 2007 20:33:47 +0800 Subject: [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 Signed-off-by: Herbert Xu --- crypto/cipher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crypto/cipher.c') diff --git a/crypto/cipher.c b/crypto/cipher.c index 0b2650c2014b..fc6b46f2a9b0 100644 --- a/crypto/cipher.c +++ b/crypto/cipher.c @@ -36,7 +36,7 @@ static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, unsigned int alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); memcpy(alignbuffer, key, keylen); ret = cia->cia_setkey(tfm, alignbuffer, keylen); - memset(alignbuffer, 0, absize); + memset(alignbuffer, 0, keylen); kfree(buffer); return ret; -- cgit v1.2.3-70-g09d2