From 070e8fefe25434394a30ae4407b825a12cce8308 Mon Sep 17 00:00:00 2001 From: Li Dongyang Date: Sat, 18 Jul 2015 00:04:03 +1000 Subject: [PATCH] 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 --- lustre/mdd/mdd_object.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- 1.8.3.1