Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bca271136f06514253aa28c24c04fc23b88e971e
Commit:     bca271136f06514253aa28c24c04fc23b88e971e
Parent:     0ce3c83a9c22f59937b86c80b478dfbffe54dbab
Author:     Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 7 20:41:07 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Mar 8 07:38:21 2007 -0800

    [PATCH] uml: hostfs: fix double free
    
    Fix double free in the error path - when name is assigned into root_inode we
    do not own it any more and we must not kfree() it - see patch for details.
    
    Thanks to William Stearns for the initial report.
    
    CC: William Stearns <[EMAIL PROTECTED]>
    Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
    Acked-by: Jeff Dike <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/hostfs/hostfs_kern.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index e965eb1..6f10e43 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -966,6 +966,9 @@ static int hostfs_fill_sb_common(struct super_block *sb, 
void *d, int silent)
                goto out_put;
 
        HOSTFS_I(root_inode)->host_filename = name;
+       /* Avoid that in the error path, iput(root_inode) frees again name 
through
+        * hostfs_destroy_inode! */
+       name = NULL;
 
        err = -ENOMEM;
        sb->s_root = d_alloc_root(root_inode);
@@ -977,7 +980,7 @@ static int hostfs_fill_sb_common(struct super_block *sb, 
void *d, int silent)
                 /* No iput in this case because the dput does that for us */
                 dput(sb->s_root);
                 sb->s_root = NULL;
-               goto out_free;
+               goto out;
         }
 
        return(0);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to