<p dir="ltr"><br>
Le 3 nov. 2015 6:46 PM, "Aaron Durbin" <<a href="mailto:adurbin@google.com">adurbin@google.com</a>> a écrit :<br>
><br>
> On Tue, Nov 3, 2015 at 10:28 AM, Vladimir 'phcoder' Serbinenko<br>
> <<a href="mailto:phcoder@gmail.com">phcoder@gmail.com</a>> wrote:<br>
> > The code itself looks good but I'd like more details. Reading 0xffffffff<br>
> > shouldn't cause reboot. Why does it?<br>
><br>
> It's probably implementation defined reading a multi-byte object from<br>
> 4GiB-1. Does it wrap? Blow up the machine? Machine check? Transaction<br>
> never gets terminated?<br>
><br>
It would be interesting to find out. Since it's P4, it may be related to PAE but paging is disabled when GRUB is active However it shouldn't hold this patch. Andrei: go ahead, just please add reference to machine and cpu in the comment and the fact that we have little idea what's going on.<br>
> ><br>
> > Le 1 nov. 2015 3:53 PM, "Andrei Borzenkov" <<a href="mailto:arvidjaar@gmail.com">arvidjaar@gmail.com</a>> a écrit :<br>
> >><br>
> >> I was debugging problem reported by user on Dell Dimension 8300 - it<br>
> >> rebooted when doing "ls -l". It turned out, the problem was triggered by<br>
> >> loading cbfs which probed for header. System has 2GB memory, and attempt to<br>
> >> read from address 0xffffffff caused instant reboot. 0xffffffff was returned<br>
> >> by read from non-existing address 0xfffffffc.<br>
> >><br>
> >> The proof of concept patch below avoids it, but I wonder what the proper<br>
> >> fix is.<br>
> >><br>
> >> diff --git a/grub-core/fs/cbfs.c b/grub-core/fs/cbfs.c<br>
> >> index a34eb88..a5a2fde 100644<br>
> >> --- a/grub-core/fs/cbfs.c<br>
> >> +++ b/grub-core/fs/cbfs.c<br>
> >> @@ -344,8 +344,9 @@ init_cbfsdisk (void)<br>
> >><br>
> >>    ptr = *(grub_uint32_t *) 0xfffffffc;<br>
> >>    head = (struct cbfs_header *) (grub_addr_t) ptr;<br>
> >> +  grub_dprintf ("cbfs", "head=%p\n", head);<br>
> >><br>
> >> -  if (!validate_head (head))<br>
> >> +  if (0xffffffff - ptr < sizeof (*head) || !validate_head (head))<br>
> >>      return;<br>
> >><br>
> >>    cbfsdisk_size = ALIGN_UP (grub_be_to_cpu32 (head->romsize),<br>
> >><br>
> >><br>
> >> _______________________________________________<br>
> >> Grub-devel mailing list<br>
> >> <a href="mailto:Grub-devel@gnu.org">Grub-devel@gnu.org</a><br>
> >> <a href="https://lists.gnu.org/mailman/listinfo/grub-devel">https://lists.gnu.org/mailman/listinfo/grub-devel</a><br>
> ><br>
> ><br>
> > --<br>
> > coreboot mailing list: <a href="mailto:coreboot@coreboot.org">coreboot@coreboot.org</a><br>
> > <a href="http://www.coreboot.org/mailman/listinfo/coreboot">http://www.coreboot.org/mailman/listinfo/coreboot</a><br>
</p>