diff options
author | Marta Rybczynska <rybczynska@gmail.com> | 2022-02-18 11:05:16 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-02 00:21:36 +0000 |
commit | db637b0555432d004597b42dcd34a47b77cd72dd (patch) | |
tree | 98ecf4be62c475b6b64f89131a6eb6a5d07a53cc /meta/recipes-bsp | |
parent | c4ca12868c22221751516ab981d802d908bf2962 (diff) | |
download | poky-db637b0555432d004597b42dcd34a47b77cd72dd.tar.gz |
grub: add a fix for unused variable in gnulib
This changes adds a fix for an unused variable issue in gnulib.
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: 30cf1e62b0f139cd6e1e3d5c09b7156acfb276b5)
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/0008-gnulib-regexec-Resolve-unused-variable.patch | 59 | ||||
-rw-r--r-- | meta/recipes-bsp/grub/grub2.inc | 1 |
2 files changed, 60 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/0008-gnulib-regexec-Resolve-unused-variable.patch b/meta/recipes-bsp/grub/files/0008-gnulib-regexec-Resolve-unused-variable.patch new file mode 100644 index 0000000000..74ffb559e9 --- /dev/null +++ b/meta/recipes-bsp/grub/files/0008-gnulib-regexec-Resolve-unused-variable.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | From 9d36bce5d516b6379ba3a0dd1a94a9c035838827 Mon Sep 17 00:00:00 2001 | ||
2 | From: Darren Kenny <darren.kenny@oracle.com> | ||
3 | Date: Wed, 21 Oct 2020 14:41:27 +0000 | ||
4 | Subject: [PATCH] gnulib/regexec: Resolve unused variable | ||
5 | |||
6 | This is a really minor issue where a variable is being assigned to but | ||
7 | not checked before it is overwritten again. | ||
8 | |||
9 | The reason for this issue is that we are not building with DEBUG set and | ||
10 | this in turn means that the assert() that reads the value of the | ||
11 | variable match_last is being processed out. | ||
12 | |||
13 | The solution, move the assignment to match_last in to an ifdef DEBUG too. | ||
14 | |||
15 | Fixes: CID 292459 | ||
16 | |||
17 | Signed-off-by: Darren Kenny <darren.kenny@oracle.com> | ||
18 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
19 | |||
20 | Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=a983d36bd9178d377d2072fd4b11c635fdc404b4] | ||
21 | Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com> | ||
22 | --- | ||
23 | conf/Makefile.extra-dist | 1 + | ||
24 | .../lib/gnulib-patches/fix-unused-value.patch | 14 ++++++++++++++ | ||
25 | 2 files changed, 15 insertions(+) | ||
26 | create mode 100644 grub-core/lib/gnulib-patches/fix-unused-value.patch | ||
27 | |||
28 | diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist | ||
29 | index 46c4e95..9b01152 100644 | ||
30 | --- a/conf/Makefile.extra-dist | ||
31 | +++ b/conf/Makefile.extra-dist | ||
32 | @@ -29,6 +29,7 @@ EXTRA_DIST += grub-core/genemuinit.sh | ||
33 | EXTRA_DIST += grub-core/genemuinitheader.sh | ||
34 | |||
35 | EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-deref.patch | ||
36 | +EXTRA_DIST += grub-core/lib/gnulib-patches/fix-unused-value.patch | ||
37 | EXTRA_DIST += grub-core/lib/gnulib-patches/fix-width.patch | ||
38 | EXTRA_DIST += grub-core/lib/gnulib-patches/no-abort.patch | ||
39 | |||
40 | diff --git a/grub-core/lib/gnulib-patches/fix-unused-value.patch b/grub-core/lib/gnulib-patches/fix-unused-value.patch | ||
41 | new file mode 100644 | ||
42 | index 0000000..ba51f1b | ||
43 | --- /dev/null | ||
44 | +++ b/grub-core/lib/gnulib-patches/fix-unused-value.patch | ||
45 | @@ -0,0 +1,14 @@ | ||
46 | +--- a/lib/regexec.c 2020-10-21 14:25:35.310195912 +0000 | ||
47 | ++++ b/lib/regexec.c 2020-10-21 14:32:07.961765604 +0000 | ||
48 | +@@ -828,7 +828,11 @@ | ||
49 | + break; | ||
50 | + if (__glibc_unlikely (err != REG_NOMATCH)) | ||
51 | + goto free_return; | ||
52 | ++#ifdef DEBUG | ||
53 | ++ /* Only used for assertion below when DEBUG is set, otherwise | ||
54 | ++ it will be over-written when we loop around. */ | ||
55 | + match_last = -1; | ||
56 | ++#endif | ||
57 | + } | ||
58 | + else | ||
59 | + break; /* We found a match. */ | ||
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc index 46d65d8609..d2a1502d56 100644 --- a/meta/recipes-bsp/grub/grub2.inc +++ b/meta/recipes-bsp/grub/grub2.inc | |||
@@ -54,6 +54,7 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \ | |||
54 | file://0005-efi-Fix-some-malformed-device-path-arithmetic-errors.patch \ | 54 | file://0005-efi-Fix-some-malformed-device-path-arithmetic-errors.patch \ |
55 | file://0006-kern-efi-Fix-memory-leak-on-failure.patch \ | 55 | file://0006-kern-efi-Fix-memory-leak-on-failure.patch \ |
56 | file://0007-kern-efi-mm-Fix-possible-NULL-pointer-dereference.patch \ | 56 | file://0007-kern-efi-mm-Fix-possible-NULL-pointer-dereference.patch \ |
57 | file://0008-gnulib-regexec-Resolve-unused-variable.patch \ | ||
57 | " | 58 | " |
58 | SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934" | 59 | SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934" |
59 | SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea" | 60 | SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea" |