[Ocfs2-devel] [patch 1/2] ocfs2: dereferencing freed pointers in ocfs2_reflink()

Dan Carpenter dan.carpenter at oracle.com
Thu Mar 5 09:46:19 PST 2015


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 at oracle.com>

diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index ee541f9..df3a500 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -4276,7 +4276,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,



More information about the Ocfs2-devel mailing list