summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp
diff options
context:
space:
mode:
authorMarta Rybczynska <rybczynska@gmail.com>2022-02-18 11:05:32 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-02 00:21:37 +0000
commit1246e75875a638c6f706344233b556e57f38d5e5 (patch)
tree289f59d00824f6b5a37209c4cd68bea3b740101d /meta/recipes-bsp
parentf4c3f4508a6353bb5359d334c58a3ded85573ec4 (diff)
downloadpoky-1246e75875a638c6f706344233b556e57f38d5e5.tar.gz
grub: fix an error check
This patch fixes an error check in grub's zfsinfo. 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: ec842684b572e5fe940762e1b5b4339e6ef6a0ba) 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/0024-zfsinfo-Correct-a-check-for-error-allocating-memory.patch35
-rw-r--r--meta/recipes-bsp/grub/grub2.inc1
2 files changed, 36 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/0024-zfsinfo-Correct-a-check-for-error-allocating-memory.patch b/meta/recipes-bsp/grub/files/0024-zfsinfo-Correct-a-check-for-error-allocating-memory.patch
new file mode 100644
index 0000000000..555dc19168
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/0024-zfsinfo-Correct-a-check-for-error-allocating-memory.patch
@@ -0,0 +1,35 @@
1From b085da8efda9b81f94aa197ee045226563554fdf Mon Sep 17 00:00:00 2001
2From: Darren Kenny <darren.kenny@oracle.com>
3Date: Thu, 26 Nov 2020 10:56:45 +0000
4Subject: [PATCH] zfsinfo: Correct a check for error allocating memory
5
6While arguably the check for grub_errno is correct, we should really be
7checking the return value from the function since it is always possible
8that grub_errno was set elsewhere, making this code behave incorrectly.
9
10Fixes: CID 73668
11
12Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
13Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
14
15Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=7aab03418ec6a9b991aa44416cb2585aff4e7972]
16Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com>
17---
18 grub-core/fs/zfs/zfsinfo.c | 4 ++--
19 1 file changed, 2 insertions(+), 2 deletions(-)
20
21diff --git a/grub-core/fs/zfs/zfsinfo.c b/grub-core/fs/zfs/zfsinfo.c
22index c8a28ac..bf29180 100644
23--- a/grub-core/fs/zfs/zfsinfo.c
24+++ b/grub-core/fs/zfs/zfsinfo.c
25@@ -358,8 +358,8 @@ grub_cmd_zfs_bootfs (grub_command_t cmd __attribute__ ((unused)), int argc,
26 return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
27
28 devname = grub_file_get_device_name (args[0]);
29- if (grub_errno)
30- return grub_errno;
31+ if (devname == NULL)
32+ return GRUB_ERR_OUT_OF_MEMORY;
33
34 dev = grub_device_open (devname);
35 grub_free (devname);
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
index 9158fc7f50..a660c069db 100644
--- a/meta/recipes-bsp/grub/grub2.inc
+++ b/meta/recipes-bsp/grub/grub2.inc
@@ -70,6 +70,7 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \
70 file://0021-zfs-Fix-possible-negative-shift-operation.patch \ 70 file://0021-zfs-Fix-possible-negative-shift-operation.patch \
71 file://0022-zfs-Fix-resource-leaks-while-constructing-path.patch \ 71 file://0022-zfs-Fix-resource-leaks-while-constructing-path.patch \
72 file://0023-zfs-Fix-possible-integer-overflows.patch \ 72 file://0023-zfs-Fix-possible-integer-overflows.patch \
73 file://0024-zfsinfo-Correct-a-check-for-error-allocating-memory.patch \
73 " 74 "
74SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934" 75SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934"
75SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea" 76SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea"