dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

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

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