mirror of
https://github.com/AuxXxilium/kmod.git
synced 2024-11-24 07:20:52 +07:00
libkmod-elf: Fix check by class in get_modversions()
Commit 51c409b
("Cache the offset of crc") unintentinally changed the
comparison "if (elf->class & KMOD_ELF_32)" to
"if (elf->class == KMOD_ELF_32)".
This has been reported by Serge Voilokov <serge0x76@gmail.com>:
On Raspberry PI elf->class equals KMOD_ELF_32|KMOD_ELF_LSB so
valid condition should be (elf->class & KMOD_ELF_32) instead of
(elf->class == KMOD_ELF_32).
This fixes "modprobe --dump-modversions" failing on 32b systems.
This commit is contained in:
parent
632fb7b463
commit
fea655dcb3
@ -516,7 +516,7 @@ int kmod_elf_get_modversions(const struct kmod_elf *elf, struct kmod_modversion
|
||||
assert_cc(sizeof(struct kmod_modversion64) ==
|
||||
sizeof(struct kmod_modversion32));
|
||||
|
||||
if (elf->class == KMOD_ELF_32)
|
||||
if (elf->class & KMOD_ELF_32)
|
||||
offcrc = sizeof(uint32_t);
|
||||
else
|
||||
offcrc = sizeof(uint64_t);
|
||||
|
Loading…
Reference in New Issue
Block a user