On Tue, May 15, 2018 at 09:18:18PM +0200, Alexander Boettcher wrote: > On 15.05.2018 21:10, Alexander Boettcher wrote: > >>I assume that a given ELF PHDR address/size does not cover VGA memory or > >>anything like that, > > > >No. > > > >>so, I am not sure what exactly overwrites this region. > >>grub_memset() in current line 161 at some point? > > > >No. During grub_relocator_prepare_reloc the overwrite happens, if i'm > >not wrong. > > > >An (artificial) example, imagine two ELF PHDRs, e.g. > > > > ??[0x8000-0x9000) and > > ??[0x2000000-0x2100000). > > > >Without this patch grub calculates one relocator chunk of size 0x20f8000 > >(0x2100000 - 0x8000) and places it at some higher memory, e.g. > >[0x3000000 - 0x30f8000). During the invocation of > > Must be [0x3000000-0x50f8000) > > >grub_relocator_prepare_reloc the memory gets copied from > > > >[0x3000000-0x30f8000) to [0x8000-0x2100000) > > Must be [0x3000000-0x50f8000) to [0x8000-0x2100000)
It seems to me that it happens a bit later. AIUI grub_relocator_prepare_reloc() prepare movers which are executed when main GRUB code is left, e.g relst() call from grub_relocator32_boot(). And the movers do bad job. Well, they were told to do so... Anyway, I think that the comment should be a bit more clear about it. Daniel _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel