From: Fan Yong Date: Tue, 3 Jun 2014 18:33:08 +0000 (+0800) Subject: LU-5324 lfsck: invalidly memory access in lfsck_del_target X-Git-Tag: 2.6.0~3 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=d0ba1093852ec25c04c7254d8a1e184a4b024294;p=fs%2Flustre-release.git LU-5324 lfsck: invalidly memory access in lfsck_del_target In lfsck_del_target(), if the given index exceeds the LFSCK targets bitmap size, then reset the local variable @ltd to avoid to access non-related memory unexpectedly. Signed-off-by: Fan Yong Change-Id: Ia06c24632352667cb452108ba094adea56ce5518 Reviewed-on: http://review.whamcloud.com/11060 Reviewed-by: Bobi Jam Tested-by: Jenkins Reviewed-by: frank zago Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/lfsck/lfsck_lib.c b/lustre/lfsck/lfsck_lib.c index fe3fcad..430522b 100644 --- a/lustre/lfsck/lfsck_lib.c +++ b/lustre/lfsck/lfsck_lib.c @@ -2636,7 +2636,7 @@ void lfsck_del_target(const struct lu_env *env, struct dt_device *key, { struct lfsck_instance *lfsck; struct lfsck_tgt_descs *ltds; - struct lfsck_tgt_desc *ltd = NULL; + struct lfsck_tgt_desc *ltd; struct list_head *head; if (for_ost) @@ -2655,6 +2655,7 @@ void lfsck_del_target(const struct lu_env *env, struct dt_device *key, } } + ltd = NULL; lfsck = __lfsck_instance_find(key, true, false); spin_unlock(&lfsck_instance_lock); if (unlikely(lfsck == NULL))