Blame SOURCES/0002-mdadm-Fix-double-free.patch

fdf7c0
From 5ce5a15f0bf007e850e15259bba4f53736605fb2 Mon Sep 17 00:00:00 2001
fdf7c0
From: Lukasz Florczak <lukasz.florczak@linux.intel.com>
fdf7c0
Date: Fri, 25 Mar 2022 12:48:59 +0100
fdf7c0
Subject: [PATCH 02/12] mdadm: Fix double free
fdf7c0
fdf7c0
If there was a size mismatch after creation it would get fixed on grow
fdf7c0
in imsm_fix_size_mismatch(), but due to double free "double free or corruption (fasttop)"
fdf7c0
error occurs and grow cannot proceed.
fdf7c0
fdf7c0
Signed-off-by: Lukasz Florczak <lukasz.florczak@linux.intel.com>
fdf7c0
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
fdf7c0
---
fdf7c0
 super-intel.c | 3 +--
fdf7c0
 1 file changed, 1 insertion(+), 2 deletions(-)
fdf7c0
fdf7c0
diff --git a/super-intel.c b/super-intel.c
fdf7c0
index 5ffa7636..6ff336ee 100644
fdf7c0
--- a/super-intel.c
fdf7c0
+++ b/super-intel.c
fdf7c0
@@ -11783,9 +11783,8 @@ static int imsm_fix_size_mismatch(struct supertype *st, int subarray_index)
fdf7c0
 			st->update_tail = &st->updates;
fdf7c0
 		} else {
fdf7c0
 			imsm_sync_metadata(st);
fdf7c0
+			free(update);
fdf7c0
 		}
fdf7c0
-
fdf7c0
-		free(update);
fdf7c0
 	}
fdf7c0
 	ret_val = 0;
fdf7c0
 exit:
fdf7c0
-- 
fdf7c0
2.31.1
fdf7c0