diff options
author | Marta Rybczynska <rybczynska@gmail.com> | 2022-02-18 11:05:17 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-02 00:21:36 +0000 |
commit | e1122f6dadec3716da709fcc9a8f31f0bc3b933e (patch) | |
tree | f30218e43f0e7069997f7fc578ebaa3b1433ea0d /meta/recipes-bsp | |
parent | db637b0555432d004597b42dcd34a47b77cd72dd (diff) | |
download | poky-e1122f6dadec3716da709fcc9a8f31f0bc3b933e.tar.gz |
grub: fix an unitialized token in gnulib
This change adds a fix for an unitialized token structure 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: 301e2ff664409011d5650339ef22225cd2028041)
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/0009-gnulib-regcomp-Fix-uninitialized-token-structure.patch | 53 | ||||
-rw-r--r-- | meta/recipes-bsp/grub/grub2.inc | 1 |
2 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/0009-gnulib-regcomp-Fix-uninitialized-token-structure.patch b/meta/recipes-bsp/grub/files/0009-gnulib-regcomp-Fix-uninitialized-token-structure.patch new file mode 100644 index 0000000000..b6e3c7edbe --- /dev/null +++ b/meta/recipes-bsp/grub/files/0009-gnulib-regcomp-Fix-uninitialized-token-structure.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From 2af8df02cca7fd4b584575eac304cd03fa23f5cc Mon Sep 17 00:00:00 2001 | ||
2 | From: Darren Kenny <darren.kenny@oracle.com> | ||
3 | Date: Thu, 22 Oct 2020 13:54:06 +0000 | ||
4 | Subject: [PATCH] gnulib/regcomp: Fix uninitialized token structure | ||
5 | |||
6 | The code is assuming that the value of br_token.constraint was | ||
7 | initialized to zero when it wasn't. | ||
8 | |||
9 | While some compilers will ensure that, not all do, so it is better to | ||
10 | fix this explicitly than leave it to chance. | ||
11 | |||
12 | Fixes: CID 73749 | ||
13 | |||
14 | Signed-off-by: Darren Kenny <darren.kenny@oracle.com> | ||
15 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
16 | |||
17 | Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=75c3d3cec4f408848f575d6d5e30a95bd6313db0] | ||
18 | Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com> | ||
19 | --- | ||
20 | conf/Makefile.extra-dist | 1 + | ||
21 | .../lib/gnulib-patches/fix-uninit-structure.patch | 11 +++++++++++ | ||
22 | 2 files changed, 12 insertions(+) | ||
23 | create mode 100644 grub-core/lib/gnulib-patches/fix-uninit-structure.patch | ||
24 | |||
25 | diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist | ||
26 | index 9b01152..9e55458 100644 | ||
27 | --- a/conf/Makefile.extra-dist | ||
28 | +++ b/conf/Makefile.extra-dist | ||
29 | @@ -29,6 +29,7 @@ EXTRA_DIST += grub-core/genemuinit.sh | ||
30 | EXTRA_DIST += grub-core/genemuinitheader.sh | ||
31 | |||
32 | EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-deref.patch | ||
33 | +EXTRA_DIST += grub-core/lib/gnulib-patches/fix-uninit-structure.patch | ||
34 | EXTRA_DIST += grub-core/lib/gnulib-patches/fix-unused-value.patch | ||
35 | EXTRA_DIST += grub-core/lib/gnulib-patches/fix-width.patch | ||
36 | EXTRA_DIST += grub-core/lib/gnulib-patches/no-abort.patch | ||
37 | diff --git a/grub-core/lib/gnulib-patches/fix-uninit-structure.patch b/grub-core/lib/gnulib-patches/fix-uninit-structure.patch | ||
38 | new file mode 100644 | ||
39 | index 0000000..7b4d9f6 | ||
40 | --- /dev/null | ||
41 | +++ b/grub-core/lib/gnulib-patches/fix-uninit-structure.patch | ||
42 | @@ -0,0 +1,11 @@ | ||
43 | +--- a/lib/regcomp.c 2020-10-22 13:49:06.770168928 +0000 | ||
44 | ++++ b/lib/regcomp.c 2020-10-22 13:50:37.026528298 +0000 | ||
45 | +@@ -3662,7 +3662,7 @@ | ||
46 | + Idx alloc = 0; | ||
47 | + #endif /* not RE_ENABLE_I18N */ | ||
48 | + reg_errcode_t ret; | ||
49 | +- re_token_t br_token; | ||
50 | ++ re_token_t br_token = {0}; | ||
51 | + bin_tree_t *tree; | ||
52 | + | ||
53 | + sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1); | ||
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc index d2a1502d56..df2c8b8a16 100644 --- a/meta/recipes-bsp/grub/grub2.inc +++ b/meta/recipes-bsp/grub/grub2.inc | |||
@@ -55,6 +55,7 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \ | |||
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 | file://0008-gnulib-regexec-Resolve-unused-variable.patch \ |
58 | file://0009-gnulib-regcomp-Fix-uninitialized-token-structure.patch \ | ||
58 | " | 59 | " |
59 | SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934" | 60 | SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934" |
60 | SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea" | 61 | SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea" |