projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4aa25bc
)
ecryptfs: use after free
author
Dan Carpenter
<
[email protected]
>
Tue, 19 Jan 2010 09:34:32 +0000
(12:34 +0300)
committer
Tyler Hicks
<
[email protected]
>
Wed, 20 Jan 2010 04:36:06 +0000
(22:36 -0600)
The "full_alg_name" variable is used on a couple error paths, so we
shouldn't free it until the end.
Signed-off-by: Dan Carpenter <
[email protected]
>
Cc:
[email protected]
Signed-off-by: Tyler Hicks <
[email protected]
>
fs/ecryptfs/crypto.c
patch
|
blob
|
history
diff --git
a/fs/ecryptfs/crypto.c
b/fs/ecryptfs/crypto.c
index fbb6e5eed6971a5a3b68e0e6c55bfa26fc8ec623..7cb0a59f4b9d2e7e6576be83d4787e599f9dd834 100644
(file)
--- a/
fs/ecryptfs/crypto.c
+++ b/
fs/ecryptfs/crypto.c
@@
-1748,7
+1748,7
@@
ecryptfs_process_key_cipher(struct crypto_blkcipher **key_tfm,
char *cipher_name, size_t *key_size)
{
char dummy_key[ECRYPTFS_MAX_KEY_BYTES];
- char *full_alg_name;
+ char *full_alg_name
= NULL
;
int rc;
*key_tfm = NULL;
@@
-1763,7
+1763,6
@@
ecryptfs_process_key_cipher(struct crypto_blkcipher **key_tfm,
if (rc)
goto out;
*key_tfm = crypto_alloc_blkcipher(full_alg_name, 0, CRYPTO_ALG_ASYNC);
- kfree(full_alg_name);
if (IS_ERR(*key_tfm)) {
rc = PTR_ERR(*key_tfm);
printk(KERN_ERR "Unable to allocate crypto cipher with name "
@@
-1786,6
+1785,7
@@
ecryptfs_process_key_cipher(struct crypto_blkcipher **key_tfm,
goto out;
}
out:
+ kfree(full_alg_name);
return rc;
}