Whamcloud - gitweb
LU-166 NOT assert wire data from client for getattr-by-fid
authornasf <yong.fan@whamcloud.com>
Sun, 27 Mar 2011 10:56:59 +0000 (18:56 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 18 Apr 2011 19:00:10 +0000 (12:00 -0700)
Change-Id: I44e96275ab53b8c7d301824487541b67b3c80cb8
Signed-off-by: nasf <yong.fan@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/367
Tested-by: Hudson
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: wangdi <di.wang@whamcloud.com>
lustre/mdt/mdt_handler.c

index 6bc3935..da0fc09 100644 (file)
@@ -848,9 +848,13 @@ static int mdt_getattr_name_lock(struct mdt_thread_info *info,
                 if (namelen == 0) {
                         reqbody = req_capsule_client_get(info->mti_pill,
                                                          &RMF_MDT_BODY);
                 if (namelen == 0) {
                         reqbody = req_capsule_client_get(info->mti_pill,
                                                          &RMF_MDT_BODY);
-                        LASSERT(fid_is_sane(&reqbody->fid2));
-                        name = NULL;
+                        if (unlikely(reqbody == NULL))
+                                RETURN(err_serious(-EFAULT));
+
+                        if (unlikely(!fid_is_sane(&reqbody->fid2)))
+                                RETURN(err_serious(-EINVAL));
 
 
+                        name = NULL;
                         CDEBUG(D_INODE, "getattr with lock for "DFID"/"DFID", "
                                "ldlm_rep = %p\n",
                                PFID(mdt_object_fid(parent)), PFID(&reqbody->fid2),
                         CDEBUG(D_INODE, "getattr with lock for "DFID"/"DFID", "
                                "ldlm_rep = %p\n",
                                PFID(mdt_object_fid(parent)), PFID(&reqbody->fid2),