linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mdadm: Fix double free
@ 2022-03-25 11:48 Lukasz Florczak
  2022-03-31 15:37 ` Jes Sorensen
  0 siblings, 1 reply; 2+ messages in thread
From: Lukasz Florczak @ 2022-03-25 11:48 UTC (permalink / raw)
  To: linux-raid; +Cc: jes, colyli

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 <lukasz.florczak@linux.intel.com>
---
 super-intel.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index d5fad102..bf6ba9ff 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mdadm: Fix double free
  2022-03-25 11:48 [PATCH] mdadm: Fix double free Lukasz Florczak
@ 2022-03-31 15:37 ` Jes Sorensen
  0 siblings, 0 replies; 2+ messages in thread
From: Jes Sorensen @ 2022-03-31 15:37 UTC (permalink / raw)
  To: Lukasz Florczak, linux-raid; +Cc: colyli

On 3/25/22 07:48, Lukasz Florczak wrote:
> 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 <lukasz.florczak@linux.intel.com>
> ---
>  super-intel.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied,

Thanks,
Jes


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-31 15:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-25 11:48 [PATCH] mdadm: Fix double free Lukasz Florczak
2022-03-31 15:37 ` Jes Sorensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).