From: yury Date: Fri, 9 Jan 2009 13:01:20 +0000 (+0000) Subject: b=18114 X-Git-Tag: v1_9_140~26 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=79b8d1d5d8a1f4bf8ae37f474e4e88b3639992ad;p=fs%2Flustre-release.git b=18114 r=umka,bzzz - patch from shadow which fixes use after free in lov_cleanup() --- diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 0e5fb37..86058ed 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -877,6 +877,10 @@ static int lov_cleanup(struct obd_device *obd) lprocfs_obd_cleanup(obd); + /* Delete hash entries and kill hash table before freeing pools + * and get to use after free issue. */ + lustre_hash_exit(lov->lov_pools_hash_body); + list_for_each_safe(pos, tmp, &lov->lov_pool_list) { pool = list_entry(pos, struct pool_desc, pool_list); /* free pool structs */ @@ -884,7 +888,6 @@ static int lov_cleanup(struct obd_device *obd) } lov_ost_pool_free(&(lov->lov_qos.lq_rr.lqr_pool)); lov_ost_pool_free(&lov->lov_packed); - lustre_hash_exit(lov->lov_pools_hash_body); if (lov->lov_tgts) { int i;