]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
libkmod-module: Remove key+value vermagic from .modinfo section
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Wed, 21 Nov 2012 20:34:50 +0000 (18:34 -0200)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Wed, 21 Nov 2012 22:22:56 +0000 (20:22 -0200)
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.

libkmod/libkmod-elf.c

index 38e83c101eb5ec5389dcac2f481e184eae3a906e..dc5a83e55cca6f7522fb5cb0a0176396d7257843 100644 (file)
@@ -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) {