lkml.org 
[lkml]   [2010]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[25/89] ecryptfs: use after free
    2.6.31-stable review patch.  If anyone has any objections, please let us know.

    ------------------

    From: Dan Carpenter <error27@gmail.com>

    commit ece550f51ba175c14ec3ec047815927d7386ea1f upstream.

    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 <error27@gmail.com>
    Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    fs/ecryptfs/crypto.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    --- a/fs/ecryptfs/crypto.c
    +++ b/fs/ecryptfs/crypto.c
    @@ -1745,7 +1745,7 @@ ecryptfs_process_key_cipher(struct crypt
    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;
    @@ -1760,7 +1760,6 @@ ecryptfs_process_key_cipher(struct crypt
    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 "
    @@ -1782,6 +1781,7 @@ ecryptfs_process_key_cipher(struct crypt
    goto out;
    }
    out:
    + kfree(full_alg_name);
    return rc;
    }




    \
     
     \ /
      Last update: 2010-03-31 02:33    [W:4.102 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site