summaryrefslogtreecommitdiffstats
path: root/Detail.c
diff options
context:
space:
mode:
authorZhipeng Xie <xiezhipeng1@huawei.com>2018-04-10 03:25:39 +0200
committerJes Sorensen <jsorensen@fb.com>2018-04-10 17:12:24 +0200
commit1c7c65a3e5d3e5f6d32bfa4cf0d872f87c654eb2 (patch)
tree15c01fc68588aedd295580a19f2dab31c4e2ce63 /Detail.c
parentmdadm: 4.1-rc1 (diff)
downloadmdadm-1c7c65a3e5d3e5f6d32bfa4cf0d872f87c654eb2.tar.xz
mdadm-1c7c65a3e5d3e5f6d32bfa4cf0d872f87c654eb2.zip
mdadm: fix use-after-free after free_mdstat
e->percent access the mdstat_ent which was already freed in free_mdstat Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to '')
-rw-r--r--Detail.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Detail.c b/Detail.c
index 4dcf81dd..860241ce 100644
--- a/Detail.c
+++ b/Detail.c
@@ -561,7 +561,6 @@ int Detail(char *dev, struct context *c)
printf(" %7s Status : %d%% complete\n",
sync_action[e->resync], e->percent);
}
- free_mdstat(ms);
if ((st && st->sb) && (info && info->reshape_active)) {
#if 0
@@ -609,6 +608,8 @@ This is pretty boring
printf("\n");
} else if (e && e->percent >= 0)
printf("\n");
+ free_mdstat(ms);
+
if (st && st->sb)
st->ss->detail_super(st, c->homehost);