From: David Howells Date: Wed, 11 Nov 2009 20:47:42 +0000 (-0500) Subject: Don't include .note.gnu.build-id in the digest X-Git-Tag: v2.6.39-400.9.0~865 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=731fb92b175a9d723d4aa4df3f9fb263b45e5247;p=users%2Fjedix%2Flinux-maple.git Don't include .note.gnu.build-id in the digest Don't include the .note.gnu.build-id ELF note in the digest as it's altered by debugedit. Signed-off-by: Aristeu Rozanski Signed-off-by: Chris Mason (cherry picked from commit 99a2f2fb5f9146139b71d3a7165c42d43ab0d978) Signed-off-by: Greg Marsden --- diff --git a/kernel/module-verify-sig.c b/kernel/module-verify-sig.c index b0511e0227df..9810ee32b368 100644 --- a/kernel/module-verify-sig.c +++ b/kernel/module-verify-sig.c @@ -213,6 +213,11 @@ int module_verify_signature(struct module_verify_data *mvdata, continue; } + /* ignore gcc's build ID section as it seems to get modified by + * the build process */ + if (strcmp(sh_name, ".note.gnu.build-id") == 0) + continue; + /* include allocatable loadable sections */ if (sh_type != SHT_NOBITS && sh_flags & SHF_ALLOC) goto include_section; diff --git a/scripts/mod/mod-extract.c b/scripts/mod/mod-extract.c index 8b36a11c6ad1..0922e3a9bb8f 100644 --- a/scripts/mod/mod-extract.c +++ b/scripts/mod/mod-extract.c @@ -510,6 +510,11 @@ static void extract_elf64(void *buffer, size_t len, Elf64_Ehdr *hdr) continue; } + /* ignore gcc's build ID section as it seems to get modified by + * the build process */ + if (strcmp(sh_name, ".note.gnu.build-id") == 0) + continue; + /* include allocatable loadable sections */ if (sh_type != SHT_NOBITS && sh_flags & SHF_ALLOC) goto include_section; @@ -861,6 +866,11 @@ static void extract_elf32(void *buffer, size_t len, Elf32_Ehdr *hdr) continue; } + /* ignore gcc's build ID section as it seems to get modified by + * the build process */ + if (strcmp(sh_name, ".note.gnu.build-id") == 0) + continue; + /* include allocatable loadable sections */ if (sh_type != SHT_NOBITS && sh_flags & SHF_ALLOC) goto include_section;