Dan Carpenter
2015-Mar-05 17:46 UTC
[Ocfs2-devel] [patch 1/2] ocfs2: dereferencing freed pointers in ocfs2_reflink()
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,
Mark Fasheh
2015-Mar-09 15:02 UTC
[Ocfs2-devel] [patch 1/2] ocfs2: dereferencing freed pointers in ocfs2_reflink()
On Thu, Mar 05, 2015 at 08:46:19PM +0300, Dan Carpenter wrote:> 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>Reviewed-by: Mark Fasheh <mfasheh at suse.de> -- Mark Fasheh