Fix memory leak in file mdadm
(cherry picked from commit 0b5ef9b3d53cba9c62b5ddc96506b362bf96f47c)
This commit is contained in:
parent
510a66a1ff
commit
c542d7105a
34
0018-fix-memory-leak-in-file-mdadm.patch
Normal file
34
0018-fix-memory-leak-in-file-mdadm.patch
Normal file
@ -0,0 +1,34 @@
|
||||
From e62a561ee8b7157a2390eab215dcef6240bd7b03 Mon Sep 17 00:00:00 2001
|
||||
From: Guanqin Miao <miaoguanqin@huawei.com>
|
||||
Date: Mon, 24 Apr 2023 16:06:37 +0800
|
||||
Subject: Fix memory leak in file mdadm
|
||||
|
||||
When we test mdadm with asan, we found some memory leaks in mdadm.c
|
||||
We fix these memory leaks based on code logic.
|
||||
|
||||
Signed-off-by: Guanqin Miao <miaoguanqin@huawei.com>
|
||||
Signed-off-by: Li Xiao Keng <lixiaokeng@huawei.com>
|
||||
Acked-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
|
||||
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
|
||||
---
|
||||
mdadm.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/mdadm.c b/mdadm.c
|
||||
index 26299b2..f0016f6 100644
|
||||
--- a/mdadm.c
|
||||
+++ b/mdadm.c
|
||||
@@ -1775,6 +1775,10 @@ int main(int argc, char *argv[])
|
||||
autodetect();
|
||||
break;
|
||||
}
|
||||
+ if (ss) {
|
||||
+ ss->ss->free_super(ss);
|
||||
+ free(ss);
|
||||
+ }
|
||||
if (locked)
|
||||
cluster_release_dlmlock();
|
||||
close_fd(&mdfd);
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Name: mdadm
|
||||
Version: 4.2
|
||||
Release: 14
|
||||
Release: 15
|
||||
Summary: The software RAID arrays user manage tools
|
||||
License: GPLv2+
|
||||
URL: http://www.kernel.org/pub/linux/utils/raid/mdadm/
|
||||
@ -27,6 +27,7 @@ Patch14: 0014-Fix-race-of-mdadm-add-and-mdadm-incremental.patch
|
||||
Patch15: 0015-mdadm-Fix-double-free.patch
|
||||
Patch16: 0016-Mdmonitor-Fix-segfault.patch
|
||||
Patch17: 0017-mdmon-fix-segfault.patch
|
||||
Patch18: 0018-fix-memory-leak-in-file-mdadm.patch
|
||||
|
||||
BuildRequires: systemd gcc binutils libudev-devel
|
||||
|
||||
@ -93,6 +94,9 @@ install -d -m 710 %{buildroot}/var/run/mdadm/
|
||||
%{_mandir}/man*/*
|
||||
|
||||
%changelog
|
||||
* Thu Jun 6 2024 zhangyaqi <zhangyaqi@kylinos.cn> - 4.2-15
|
||||
- fix memory leak in file mdadm
|
||||
|
||||
* Wed May 15 2024 Deyuan Fan <fandeyuan@kylinos.cn> - 4.2-14
|
||||
- mdmon: fix segfault
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user