mirror of
https://github.com/dynup/kpatch
synced 2025-03-25 04:16:39 +00:00
Fix false-positives in kpatch_check_relocations
Because of signedness difference kpatch_check_relocations() would trigger an error on any negative addend. Fix by casting Elf_Data->d_size from size_t to int. Signed-off-by: Artem Savkov <asavkov@redhat.com>
This commit is contained in:
parent
88e9eb3ee0
commit
4591c0701c
@ -1935,7 +1935,7 @@ static void kpatch_check_relocations(struct kpatch_elf *kelf)
|
||||
list_for_each_entry(rela, &sec->relas, list) {
|
||||
if (rela->sym->sec) {
|
||||
sdata = rela->sym->sec->data;
|
||||
if (rela->addend > sdata->d_size) {
|
||||
if (rela->addend > (int)sdata->d_size) {
|
||||
ERROR("out-of-range relocation %s+%x in %s", rela->sym->sec->name,
|
||||
rela->addend, sec->name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user