Whamcloud - gitweb
LU-1823 mdd: Don't provide buffer for xattr when we just need size
authorOleg Drokin <green@whamcloud.com>
Mon, 10 Sep 2012 23:46:41 +0000 (19:46 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 12 Sep 2012 04:30:41 +0000 (00:30 -0400)
mdd_declare_attr_set incorrectly passed uninitialized buffer to mdo_xattr_get
where as it is just interested in knowing if xattr exists at all.
The buffer happens to point to other people's data sometimes which leads
to random memory corruptions.

Change-Id: I28b477d385427292ad38455d495ab546f757c7d5
Signed-off-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/3928
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/mdd/mdd_object.c

index 0cc62fa..89c26c4 100644 (file)
@@ -1578,7 +1578,7 @@ static int mdd_declare_attr_set(const struct lu_env *env,
 #ifdef CONFIG_FS_POSIX_ACL
         if (ma->ma_attr.la_valid & LA_MODE) {
                 mdd_read_lock(env, obj, MOR_TGT_CHILD);
-                rc = mdo_xattr_get(env, obj, buf, XATTR_NAME_ACL_ACCESS,
+                rc = mdo_xattr_get(env, obj, &LU_BUF_NULL,XATTR_NAME_ACL_ACCESS,
                                    BYPASS_CAPA);
                 mdd_read_unlock(env, obj);
                 if (rc == -EOPNOTSUPP || rc == -ENODATA)