diff --git a/ChangeLog b/ChangeLog index cddcf3897..2b9f300bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-12-09 Vladimir Serbinenko + + * grub-core/kern/sparc64/dl.c (grub_arch_dl_relocate_symbols): Check + range of R_SPARC_HI22. + Implement R_SPARC_LM22. + 2013-12-09 Vladimir Serbinenko * grub-core/kern/powerpc/dl_helper.c (grub_arch_dl_get_tramp_got_size): diff --git a/grub-core/kern/sparc64/dl.c b/grub-core/kern/sparc64/dl.c index fa086ff5c..c6cac6838 100644 --- a/grub-core/kern/sparc64/dl.c +++ b/grub-core/kern/sparc64/dl.c @@ -90,6 +90,10 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, *addr = (*addr & 0xFFFFFC00) | ((value >> 32) & 0x3FF); break; case R_SPARC_HI22: /* 9 V-imm22 */ + if (value >> 32) + return grub_error (GRUB_ERR_BAD_MODULE, + "address out of 32 bits range"); + case R_SPARC_LM22: *addr = (*addr & 0xFFC00000) | ((value >> 10) & 0x3FFFFF); break; case R_SPARC_LO10: /* 12 T-simm13 */