From 88dd29f38769744eac20b06e1baac52872bf423f Mon Sep 17 00:00:00 2001 From: nasf Date: Sun, 27 Mar 2011 18:56:59 +0800 Subject: [PATCH 1/1] LU-166 NOT assert wire data from client for getattr-by-fid Change-Id: I44e96275ab53b8c7d301824487541b67b3c80cb8 Signed-off-by: nasf Reviewed-on: http://review.whamcloud.com/367 Tested-by: Hudson Reviewed-by: Oleg Drokin Reviewed-by: wangdi --- lustre/mdt/mdt_handler.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 6bc3935..da0fc09 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -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); - 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), -- 1.8.3.1