From: Oleg Drokin Date: Mon, 10 Sep 2012 23:46:41 +0000 (-0400) Subject: LU-1823 mdd: Don't provide buffer for xattr when we just need size X-Git-Tag: 2.3.51~119 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=15ea8482254911357109bcaa72630511d09e5f07 LU-1823 mdd: Don't provide buffer for xattr when we just need size 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 Reviewed-on: http://review.whamcloud.com/3928 Reviewed-by: Andreas Dilger Tested-by: Hudson Reviewed-by: Mike Pershin Tested-by: Maloo --- diff --git a/lustre/mdd/mdd_object.c b/lustre/mdd/mdd_object.c index 0cc62fa..89c26c4 100644 --- a/lustre/mdd/mdd_object.c +++ b/lustre/mdd/mdd_object.c @@ -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)