ceph: fix xattr dangling pointer / double free
authorSage Weil <sage@newdream.net>
Thu, 29 Apr 2010 16:28:11 +0000 (09:28 -0700)
committerSage Weil <sage@newdream.net>
Mon, 17 May 2010 22:25:25 +0000 (15:25 -0700)
If we use the xattr_blob, clear the pointer so we don't release the memory
at the bottom of the fuction.

Reported-by: Henry C Chang <henry_c_chang@tcloudcomputing.com>
Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/inode.c

index ef917232cf370ba883abf98b2f130aeaa05110ec..913cafd70cd0e5fae476f655ba92da07f8a22cc5 100644 (file)
@@ -619,6 +619,7 @@ static int fill_inode(struct inode *inode,
                        memcpy(ci->i_xattrs.blob->vec.iov_base,
                               iinfo->xattr_data, iinfo->xattr_len);
                ci->i_xattrs.version = le64_to_cpu(info->xattr_version);
+               xattr_blob = NULL;
        }
 
        inode->i_mapping->a_ops = &ceph_aops;