Commit 26f872d1 authored by Dan Carpenter's avatar Dan Carpenter Committed by Ben Hutchings

ocfs2: dereferencing freed pointers in ocfs2_reflink()

commit e073fc58 upstream.

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarMark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent e46e5c25
...@@ -4278,7 +4278,7 @@ static int ocfs2_reflink(struct dentry *old_dentry, struct inode *dir, ...@@ -4278,7 +4278,7 @@ static int ocfs2_reflink(struct dentry *old_dentry, struct inode *dir,
error = posix_acl_create(dir, &mode, &default_acl, &acl); error = posix_acl_create(dir, &mode, &default_acl, &acl);
if (error) { if (error) {
mlog_errno(error); mlog_errno(error);
goto out; return error;
} }
error = ocfs2_create_inode_in_orphan(dir, mode, error = ocfs2_create_inode_in_orphan(dir, mode,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment