diff --git a/0012-mdadm-Fix-double-free.patch b/0012-mdadm-Fix-double-free.patch new file mode 100644 index 0000000000000000000000000000000000000000..215df47f72f4980d7740df8dd90d5125cab0bd02 --- /dev/null +++ b/0012-mdadm-Fix-double-free.patch @@ -0,0 +1,33 @@ +From 5ce5a15f0bf007e850e15259bba4f53736605fb2 Mon Sep 17 00:00:00 2001 +From: Lukasz Florczak +Date: Fri, 25 Mar 2022 12:48:59 +0100 +Subject: mdadm: Fix double free + +If there was a size mismatch after creation it would get fixed on grow +in imsm_fix_size_mismatch(), but due to double free "double free or corruption (fasttop)" +error occurs and grow cannot proceed. + +Signed-off-by: Lukasz Florczak +Signed-off-by: Jes Sorensen +--- + super-intel.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/super-intel.c b/super-intel.c +index d5fad10..bf6ba9f 100644 +--- a/super-intel.c ++++ b/super-intel.c +@@ -11783,9 +11783,8 @@ static int imsm_fix_size_mismatch(struct supertype *st, int subarray_index) + st->update_tail = &st->updates; + } else { + imsm_sync_metadata(st); ++ free(update); + } +- +- free(update); + } + ret_val = 0; + exit: +-- +2.27.0 + diff --git a/mdadm.spec b/mdadm.spec index b1c094f13194c13b1d303548b0232d557ce481c6..65b14913c4bb4283583a9a2828971411d85fd608 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -1,6 +1,6 @@ Name: mdadm Version: 4.2 -Release: 10 +Release: 11 Summary: The software RAID arrays user manage tools License: GPLv2+ URL: http://www.kernel.org/pub/linux/utils/raid/mdadm/ @@ -21,6 +21,7 @@ Patch8: 0008-fix-NULL-dereference-in-super_by_fd.patch Patch9: 0009-fix-mdmonitor-oneshot.service-start-error.patch Patch10: 0010-Fix-null-pointer-for-incremental-in-mdadm.patch Patch11: 0011-Fix-race-of-mdadm-add-and-mdadm-incremental.patch +Patch12: 0012-mdadm-Fix-double-free.patch BuildRequires: systemd gcc binutils libudev-devel Requires(post): systemd coreutils @@ -86,6 +87,9 @@ install -d -m 710 %{buildroot}/var/run/mdadm/ %{_mandir}/man*/* %changelog +* Wed May 29 2024 liuh - 4.2-11 +- sync patch from community + * Thu Dec 14 2023 wuguanghao - 4.2-10 * Fix race of "mdadm --add" and "mdadm --incremental"