diff options
author | Marta Rybczynska <rybczynska@gmail.com> | 2022-02-18 11:05:25 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-02 00:21:37 +0000 |
commit | b854e27c584ea746b6274d3c69b9d6346afe38ed (patch) | |
tree | aedb20f75fe3664c34852f4e4cb97fe63fcd89a3 /meta | |
parent | da4ba2d04e3dabf2ab0432e7abecd4a78dabdde5 (diff) | |
download | poky-b854e27c584ea746b6274d3c69b9d6346afe38ed.tar.gz |
grub: fix a memory leak
This patch adds a fix for a memory leak in grub's disk/ldm.
It 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: 444a690c28fa78147273213f2ae19b1a67027a71)
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')
-rw-r--r-- | meta/recipes-bsp/grub/files/0017-disk-ldm-If-failed-then-free-vg-variable-too.patch | 28 | ||||
-rw-r--r-- | meta/recipes-bsp/grub/grub2.inc | 1 |
2 files changed, 29 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/0017-disk-ldm-If-failed-then-free-vg-variable-too.patch b/meta/recipes-bsp/grub/files/0017-disk-ldm-If-failed-then-free-vg-variable-too.patch new file mode 100644 index 0000000000..ecdb230f76 --- /dev/null +++ b/meta/recipes-bsp/grub/files/0017-disk-ldm-If-failed-then-free-vg-variable-too.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From 253485e8df3c9dedac848567e638157530184295 Mon Sep 17 00:00:00 2001 | ||
2 | From: Paulo Flabiano Smorigo <pfsmorigo@canonical.com> | ||
3 | Date: Mon, 7 Dec 2020 10:07:47 -0300 | ||
4 | Subject: [PATCH] disk/ldm: If failed then free vg variable too | ||
5 | |||
6 | Fixes: CID 73809 | ||
7 | |||
8 | Signed-off-by: Paulo Flabiano Smorigo <pfsmorigo@canonical.com> | ||
9 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
10 | |||
11 | Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=e0b83df5da538d2a38f770e60817b3a4b9d5b4d7] | ||
12 | Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com> | ||
13 | --- | ||
14 | grub-core/disk/ldm.c | 1 + | ||
15 | 1 file changed, 1 insertion(+) | ||
16 | |||
17 | diff --git a/grub-core/disk/ldm.c b/grub-core/disk/ldm.c | ||
18 | index 428415f..54713f4 100644 | ||
19 | --- a/grub-core/disk/ldm.c | ||
20 | +++ b/grub-core/disk/ldm.c | ||
21 | @@ -199,6 +199,7 @@ make_vg (grub_disk_t disk, | ||
22 | { | ||
23 | grub_free (vg->uuid); | ||
24 | grub_free (vg->name); | ||
25 | + grub_free (vg); | ||
26 | return NULL; | ||
27 | } | ||
28 | grub_memcpy (vg->uuid, label->group_guid, LDM_GUID_STRLEN); | ||
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc index 479e2f71f2..a8ee0dd68a 100644 --- a/meta/recipes-bsp/grub/grub2.inc +++ b/meta/recipes-bsp/grub/grub2.inc | |||
@@ -63,6 +63,7 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \ | |||
63 | file://0014-zstd-Initialize-seq_t-structure-fully.patch \ | 63 | file://0014-zstd-Initialize-seq_t-structure-fully.patch \ |
64 | file://0015-kern-partition-Check-for-NULL-before-dereferencing-i.patch \ | 64 | file://0015-kern-partition-Check-for-NULL-before-dereferencing-i.patch \ |
65 | file://0016-disk-ldm-Make-sure-comp-data-is-freed-before-exiting.patch \ | 65 | file://0016-disk-ldm-Make-sure-comp-data-is-freed-before-exiting.patch \ |
66 | file://0017-disk-ldm-If-failed-then-free-vg-variable-too.patch \ | ||
66 | " | 67 | " |
67 | SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934" | 68 | SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934" |
68 | SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea" | 69 | SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea" |