mirror of
https://github.com/dynup/kpatch
synced 2025-01-25 22:32:43 +00:00
Merge pull request #1172 from jpoimboe/out-of-range-rela-fix
A couple of fixes for the out-of-range relocation check
This commit is contained in:
commit
97b69bee75
@ -2546,8 +2546,8 @@ 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 > (long)sdata->d_size) {
|
||||
ERROR("out-of-range relocation %s+%lx in %s", rela->sym->sec->name,
|
||||
if ((long)rela->sym->sym.st_value + rela->addend > (long)sdata->d_size) {
|
||||
ERROR("out-of-range relocation %s+%lx in %s", rela->sym->name,
|
||||
rela->addend, sec->name);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user