]> git.itanic.dy.fi Git - linux-stable/commitdiff
ocfs2: dereferencing freed pointers in ocfs2_reflink()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 14 Apr 2015 22:43:19 +0000 (15:43 -0700)
committerSasha Levin <sasha.levin@oracle.com>
Wed, 18 May 2016 02:25:26 +0000 (22:25 -0400)
[ Upstream commit e073fc58dfe6a4c9b614320c1d56bb71cb213ec4 ]

The code at the "out" label assumes that "default_acl" and "acl" are NULL,
but actually the pointers can be NULL, unitialized, or freed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
fs/ocfs2/refcounttree.c

index d81f6e2a97f5d4c70d6324cf0a7483a874cd7b9a..e794c38bf900a1ff37980cac86f09d48faeb8006 100644 (file)
@@ -4278,7 +4278,7 @@ static int ocfs2_reflink(struct dentry *old_dentry, struct inode *dir,
        error = posix_acl_create(dir, &mode, &default_acl, &acl);
        if (error) {
                mlog_errno(error);
-               goto out;
+               return error;
        }
 
        error = ocfs2_create_inode_in_orphan(dir, mode,