From: Lucas De Marchi Date: Wed, 21 Nov 2012 20:34:50 +0000 (-0200) Subject: libkmod-module: Remove key+value vermagic from .modinfo section X-Git-Tag: v12~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d196b8d99f0a46d5e96678daabe74fda94875886;p=thirdparty%2Fkmod.git libkmod-module: Remove key+value vermagic from .modinfo section When told to force load a module, we were removing only the value of vermagic instead of the complete entry. Philippe De Swert (philippe.deswert@jollamobile.com) sent a patch that was additionally mangling also the last two chars of the key ("vermagic="). Instead of creating an invalid entry in .modinfo section like this, this patch removes the complete entry, key + value, by zeroing the entire string. Much thanks to Philippe who found the issue and pointed to the fix. --- diff --git a/libkmod/libkmod-elf.c b/libkmod/libkmod-elf.c index 38e83c10..dc5a83e5 100644 --- a/libkmod/libkmod-elf.c +++ b/libkmod/libkmod-elf.c @@ -611,7 +611,6 @@ int kmod_elf_strip_vermagic(struct kmod_elf *elf) i += strlen(s); continue; } - s += len; off = (const uint8_t *)s - elf->memory; if (elf->changed == NULL) {