summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-bsp/grub/files/0010-gnulib-argp-help-Fix-dereference-of-a-possibly-NULL-.patch52
-rw-r--r--meta/recipes-bsp/grub/grub2.inc1
2 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/0010-gnulib-argp-help-Fix-dereference-of-a-possibly-NULL-.patch b/meta/recipes-bsp/grub/files/0010-gnulib-argp-help-Fix-dereference-of-a-possibly-NULL-.patch
new file mode 100644
index 0000000000..102a494561
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/0010-gnulib-argp-help-Fix-dereference-of-a-possibly-NULL-.patch
@@ -0,0 +1,52 @@
1From eaf9da8b5f8349c51cfc89dd8e39a1a61f89790a Mon Sep 17 00:00:00 2001
2From: Darren Kenny <darren.kenny@oracle.com>
3Date: Wed, 28 Oct 2020 14:43:01 +0000
4Subject: [PATCH] gnulib/argp-help: Fix dereference of a possibly NULL state
5
6All other instances of call to __argp_failure() where there is
7a dgettext() call is first checking whether state is NULL before
8attempting to dereference it to get the root_argp->argp_domain.
9
10Fixes: CID 292436
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=3a37bf120a9194c373257c70175cdb5b337bc107]
16Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com>
17---
18 conf/Makefile.extra-dist | 1 +
19 .../lib/gnulib-patches/fix-null-state-deref.patch | 12 ++++++++++++
20 2 files changed, 13 insertions(+)
21 create mode 100644 grub-core/lib/gnulib-patches/fix-null-state-deref.patch
22
23diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist
24index 9e55458..96d7e69 100644
25--- a/conf/Makefile.extra-dist
26+++ b/conf/Makefile.extra-dist
27@@ -29,6 +29,7 @@ EXTRA_DIST += grub-core/genemuinit.sh
28 EXTRA_DIST += grub-core/genemuinitheader.sh
29
30 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-deref.patch
31+EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-state-deref.patch
32 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-uninit-structure.patch
33 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-unused-value.patch
34 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-width.patch
35diff --git a/grub-core/lib/gnulib-patches/fix-null-state-deref.patch b/grub-core/lib/gnulib-patches/fix-null-state-deref.patch
36new file mode 100644
37index 0000000..813ec09
38--- /dev/null
39+++ b/grub-core/lib/gnulib-patches/fix-null-state-deref.patch
40@@ -0,0 +1,12 @@
41+--- a/lib/argp-help.c 2020-10-28 14:32:19.189215988 +0000
42++++ b/lib/argp-help.c 2020-10-28 14:38:21.204673940 +0000
43+@@ -145,7 +145,8 @@
44+ if (*(int *)((char *)upptr + up->uparams_offs) >= upptr->rmargin)
45+ {
46+ __argp_failure (state, 0, 0,
47+- dgettext (state->root_argp->argp_domain,
48++ dgettext (state == NULL ? NULL
49++ : state->root_argp->argp_domain,
50+ "\
51+ ARGP_HELP_FMT: %s value is less than or equal to %s"),
52+ "rmargin", up->name);
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
index df2c8b8a16..94873475c1 100644
--- a/meta/recipes-bsp/grub/grub2.inc
+++ b/meta/recipes-bsp/grub/grub2.inc
@@ -56,6 +56,7 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \
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 file://0009-gnulib-regcomp-Fix-uninitialized-token-structure.patch \
59 file://0010-gnulib-argp-help-Fix-dereference-of-a-possibly-NULL-.patch \
59 " 60 "
60SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934" 61SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934"
61SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea" 62SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea"