From: Arne Fitzenreiter Date: Wed, 5 Jul 2017 15:42:21 +0000 (+0200) Subject: grub: ignore missing .symtab in modules X-Git-Tag: v2.19-core112~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=da504bdc57564434629c485ee12b64f76adf722d;p=people%2Fstevee%2Fipfire-2.x.git grub: ignore missing .symtab in modules 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 --- diff --git a/lfs/grub b/lfs/grub index 494fea9c53..8b82189fce 100644 --- 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 index 0000000000..fbaa26ec34 --- /dev/null +++ b/src/patches/grub-2.00_ignore_missing_symtab.patch @@ -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; +