]> git.ipfire.org Git - people/mlorenz/ipfire-2.x.git/commitdiff
grub: ignore missing .symtab in modules
authorArne Fitzenreiter <arne_f@ipfire.org>
Wed, 5 Jul 2017 15:42:21 +0000 (17:42 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Wed, 5 Jul 2017 15:42:21 +0000 (17:42 +0200)
old binutis add an empty .symtab section at stripping
and grub check that this exists also on modules that export
no symbols.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
lfs/grub
src/patches/grub-2.00_ignore_missing_symtab.patch [new file with mode: 0644]

index 494fea9c533cd61360072a1a5a6b69c7290ff8b2..8b82189fce16a7015a7e13355a3ee2555f03a2da 100644 (file)
--- a/lfs/grub
+++ b/lfs/grub
@@ -80,6 +80,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub-2.00_disable_vga_fallback.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/0001-Fix-CVE-2015-8370-Grub2-user-pass-vulnerability.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub2-remove-gets.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub-2.00_ignore_missing_symtab.patch
        cd $(DIR_APP) && \
                ./configure \
                        --prefix=/usr \
diff --git a/src/patches/grub-2.00_ignore_missing_symtab.patch b/src/patches/grub-2.00_ignore_missing_symtab.patch
new file mode 100644 (file)
index 0000000..fbaa26e
--- /dev/null
@@ -0,0 +1,40 @@
+diff -Naur grub-2.00.org/grub-core/kern/dl.c grub-2.00/grub-core/kern/dl.c
+--- grub-2.00.org/grub-core/kern/dl.c  2012-06-22 17:26:38.000000000 +0200
++++ grub-2.00/grub-core/kern/dl.c      2017-07-05 10:45:25.501645684 +0200
+@@ -354,8 +354,11 @@
+     if (s->sh_type == SHT_SYMTAB)
+       break;
++  /* Module without symbol table may still be used to pull in dependencies.
++     We verify at build time that such modules do not contain any relocations
++     that may reference symbol table. */
+   if (i == e->e_shnum)
+-    return grub_error (GRUB_ERR_BAD_MODULE, N_("no symbol table"));
++     return GRUB_ERR_NONE;
+ #ifdef GRUB_MODULES_MACHINE_READONLY
+   mod->symtab = grub_malloc (s->sh_size);
+diff -Naur grub-2.00.org/grub-core/kern/i386/dl.c grub-2.00/grub-core/kern/i386/dl.c
+--- grub-2.00.org/grub-core/kern/i386/dl.c     2012-02-26 12:14:21.000000000 +0100
++++ grub-2.00/grub-core/kern/i386/dl.c 2017-07-05 17:01:43.333955065 +0200
+@@ -55,7 +55,7 @@
+       break;
+   if (i == e->e_shnum)
+-    return grub_error (GRUB_ERR_BAD_MODULE, N_("no symbol table"));
++    return GRUB_ERR_NONE;
+   entsize = s->sh_entsize;
+diff -Naur grub-2.00.org/grub-core/kern/x86_64/dl.c grub-2.00/grub-core/kern/x86_64/dl.c
+--- grub-2.00.org/grub-core/kern/x86_64/dl.c   2012-02-26 12:14:56.000000000 +0100
++++ grub-2.00/grub-core/kern/x86_64/dl.c       2017-07-05 17:02:23.374574458 +0200
+@@ -55,7 +55,7 @@
+       break;
+   if (i == e->e_shnum)
+-    return grub_error (GRUB_ERR_BAD_MODULE, N_("no symbol table"));
++    return GRUB_ERR_NONE;
+   entsize = s->sh_entsize;