summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp
diff options
context:
space:
mode:
authorMarta Rybczynska <rybczynska@gmail.com>2022-02-18 11:05:09 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-02 00:21:36 +0000
commit01eb48b7f5681f2c4a51ae63243a7c7ccdc8435e (patch)
treecd5c38357f899ea06534490394ccdcd5ac2fc4f6 /meta/recipes-bsp
parentac746716fc5109848bceabdc6284c1de1194df39 (diff)
downloadpoky-01eb48b7f5681f2c4a51ae63243a7c7ccdc8435e.tar.gz
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>
Diffstat (limited to 'meta/recipes-bsp')
-rw-r--r--meta/recipes-bsp/grub/files/0001-mmap-Fix-memory-leak-when-iterating-over-mapped-memo.patch39
-rw-r--r--meta/recipes-bsp/grub/grub2.inc3
2 files changed, 41 insertions, 1 deletions
diff --git a/meta/recipes-bsp/grub/files/0001-mmap-Fix-memory-leak-when-iterating-over-mapped-memo.patch b/meta/recipes-bsp/grub/files/0001-mmap-Fix-memory-leak-when-iterating-over-mapped-memo.patch
new file mode 100644
index 0000000000..eaaa7effae
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/0001-mmap-Fix-memory-leak-when-iterating-over-mapped-memo.patch
@@ -0,0 +1,39 @@
1From 0900f11def2e7fbb4880efff0cd9c9b32f1cdb86 Mon Sep 17 00:00:00 2001
2From: Darren Kenny <darren.kenny@oracle.com>
3Date: Thu, 3 Dec 2020 14:39:45 +0000
4Subject: [PATCH] mmap: Fix memory leak when iterating over mapped memory
5
6When returning from grub_mmap_iterate() the memory allocated to present
7is not being released causing it to leak.
8
9Fixes: CID 96655
10
11Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
12Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
13
14Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=8cb2848f9699642a698af84b12ba187cab722031]
15Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com>
16---
17 grub-core/mmap/mmap.c | 2 ++
18 1 file changed, 2 insertions(+)
19
20diff --git a/grub-core/mmap/mmap.c b/grub-core/mmap/mmap.c
21index 7ebf32e..8bf235f 100644
22--- a/grub-core/mmap/mmap.c
23+++ b/grub-core/mmap/mmap.c
24@@ -270,6 +270,7 @@ grub_mmap_iterate (grub_memory_hook_t hook, void *hook_data)
25 hook_data))
26 {
27 grub_free (ctx.scanline_events);
28+ grub_free (present);
29 return GRUB_ERR_NONE;
30 }
31
32@@ -282,6 +283,7 @@ grub_mmap_iterate (grub_memory_hook_t hook, void *hook_data)
33 }
34
35 grub_free (ctx.scanline_events);
36+ grub_free (present);
37 return GRUB_ERR_NONE;
38 }
39
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
index 9b20e1c09b..a06beac5ef 100644
--- a/meta/recipes-bsp/grub/grub2.inc
+++ b/meta/recipes-bsp/grub/grub2.inc
@@ -47,7 +47,8 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \
47 file://CVE-2020-27779_7.patch \ 47 file://CVE-2020-27779_7.patch \
48 file://CVE-2020-25632.patch \ 48 file://CVE-2020-25632.patch \
49 file://CVE-2020-25647.patch \ 49 file://CVE-2020-25647.patch \
50" 50 file://0001-mmap-Fix-memory-leak-when-iterating-over-mapped-memo.patch \
51 "
51SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934" 52SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934"
52SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea" 53SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea"
53 54