Blame SOURCES/0001-mdadm-fix-use-after-free-after-free_mdstat.patch

59ea72
From 1c7c65a3e5d3e5f6d32bfa4cf0d872f87c654eb2 Mon Sep 17 00:00:00 2001
59ea72
From: Zhipeng Xie <xiezhipeng1@huawei.com>
59ea72
Date: Tue, 10 Apr 2018 09:25:39 +0800
59ea72
Subject: [RHEL7.5 PATCH 01/26] mdadm: fix use-after-free after free_mdstat
59ea72
59ea72
e->percent access the mdstat_ent which was already freed in free_mdstat
59ea72
59ea72
Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com>
59ea72
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
59ea72
---
59ea72
 Detail.c | 3 ++-
59ea72
 1 file changed, 2 insertions(+), 1 deletion(-)
59ea72
59ea72
diff --git a/Detail.c b/Detail.c
59ea72
index 4dcf81d..860241c 100644
59ea72
--- a/Detail.c
59ea72
+++ b/Detail.c
59ea72
@@ -561,7 +561,6 @@ int Detail(char *dev, struct context *c)
59ea72
 			printf("    %7s Status : %d%% complete\n",
59ea72
 			       sync_action[e->resync], e->percent);
59ea72
 		}
59ea72
-		free_mdstat(ms);
59ea72
 
59ea72
 		if ((st && st->sb) && (info && info->reshape_active)) {
59ea72
 #if 0
59ea72
@@ -609,6 +608,8 @@ This is pretty boring
59ea72
 			printf("\n");
59ea72
 		} else if (e && e->percent >= 0)
59ea72
 			printf("\n");
59ea72
+		free_mdstat(ms);
59ea72
+
59ea72
 		if (st && st->sb)
59ea72
 			st->ss->detail_super(st, c->homehost);
59ea72
 
59ea72
-- 
59ea72
2.7.4
59ea72