From: Li Dongyang Date: Fri, 17 Jul 2015 14:04:03 +0000 (+1000) Subject: LU-6865 mdd: check return value of posix_acl_from_xattr X-Git-Tag: 2.7.62~48 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F33%2F15633%2F8;p=fs%2Flustre-release.git LU-6865 mdd: check return value of posix_acl_from_xattr passing a ERR_PTR to posix_acl_release will cause a crash Signed-off-by: Li Dongyang Change-Id: I1870121e2f4fb187cd8c58f263b651ddf83a574b Reviewed-on: http://review.whamcloud.com/15633 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger --- diff --git a/lustre/mdd/mdd_object.c b/lustre/mdd/mdd_object.c index 8e69704..e283a64 100644 --- a/lustre/mdd/mdd_object.c +++ b/lustre/mdd/mdd_object.c @@ -1035,6 +1035,8 @@ static int mdd_xattr_set(const struct lu_env *env, struct md_object *obj, * ACL. */ acl = posix_acl_from_xattr(&init_user_ns, buf->lb_buf, buf->lb_len); + if (IS_ERR(acl)) + RETURN(PTR_ERR(acl)); if (acl == NULL) { rc = mdd_xattr_del(env, obj, name); RETURN(rc);