mirror of
https://git.yoctoproject.org/poky
synced 2026-02-06 16:56:37 +01:00
grub: fix a memory leak
Backport a fix for a memory leak in grub_mmap_iterate(). This patch is a part of a security series [1] [1] https://lists.gnu.org/archive/html/grub-devel/2021-03/msg00007.html (From OE-Core rev: 330ef99ae58e025b78bf30b9a9d09b32dfa2f605) Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
ac746716fc
commit
01eb48b7f5
@@ -0,0 +1,39 @@
|
||||
From 0900f11def2e7fbb4880efff0cd9c9b32f1cdb86 Mon Sep 17 00:00:00 2001
|
||||
From: Darren Kenny <darren.kenny@oracle.com>
|
||||
Date: Thu, 3 Dec 2020 14:39:45 +0000
|
||||
Subject: [PATCH] mmap: Fix memory leak when iterating over mapped memory
|
||||
|
||||
When returning from grub_mmap_iterate() the memory allocated to present
|
||||
is not being released causing it to leak.
|
||||
|
||||
Fixes: CID 96655
|
||||
|
||||
Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
|
||||
Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=8cb2848f9699642a698af84b12ba187cab722031]
|
||||
Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com>
|
||||
---
|
||||
grub-core/mmap/mmap.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/grub-core/mmap/mmap.c b/grub-core/mmap/mmap.c
|
||||
index 7ebf32e..8bf235f 100644
|
||||
--- a/grub-core/mmap/mmap.c
|
||||
+++ b/grub-core/mmap/mmap.c
|
||||
@@ -270,6 +270,7 @@ grub_mmap_iterate (grub_memory_hook_t hook, void *hook_data)
|
||||
hook_data))
|
||||
{
|
||||
grub_free (ctx.scanline_events);
|
||||
+ grub_free (present);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
@@ -282,6 +283,7 @@ grub_mmap_iterate (grub_memory_hook_t hook, void *hook_data)
|
||||
}
|
||||
|
||||
grub_free (ctx.scanline_events);
|
||||
+ grub_free (present);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,8 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \
|
||||
file://CVE-2020-27779_7.patch \
|
||||
file://CVE-2020-25632.patch \
|
||||
file://CVE-2020-25647.patch \
|
||||
"
|
||||
file://0001-mmap-Fix-memory-leak-when-iterating-over-mapped-memo.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934"
|
||||
SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user