2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
* loader/sparc64/ieee1275/linux.c (alloc_phys): Correct bounds checking.
This commit is contained in:
parent
17cec782c4
commit
8c6052cea5
2 changed files with 9 additions and 5 deletions
|
@ -1,3 +1,7 @@
|
|||
2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* loader/sparc64/ieee1275/linux.c (alloc_phys): Correct bounds checking.
|
||||
|
||||
2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* kern/sparc64/ieee1275/crt0.S (codestart): Move modules backwards.
|
||||
|
|
|
@ -193,20 +193,20 @@ alloc_phys (grub_addr_t size)
|
|||
return 0;
|
||||
|
||||
addr = align_addr (addr, FOUR_MB);
|
||||
if (addr >= end)
|
||||
if (addr + size >= end)
|
||||
return 0;
|
||||
|
||||
if (addr >= grub_phys_start && addr < grub_phys_end)
|
||||
{
|
||||
addr = align_addr (grub_phys_end, FOUR_MB);
|
||||
if (addr >= end)
|
||||
if (addr + size >= end)
|
||||
return 0;
|
||||
}
|
||||
if ((addr + size) >= grub_phys_start
|
||||
&& (addr + size) < grub_phys_end)
|
||||
{
|
||||
addr = align_addr (grub_phys_end, FOUR_MB);
|
||||
if (addr >= end)
|
||||
if (addr + size >= end)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -217,14 +217,14 @@ alloc_phys (grub_addr_t size)
|
|||
if (addr >= linux_paddr && addr < linux_end)
|
||||
{
|
||||
addr = linux_end;
|
||||
if (addr >= end)
|
||||
if (addr + size >= end)
|
||||
return 0;
|
||||
}
|
||||
if ((addr + size) >= linux_paddr
|
||||
&& (addr + size) < linux_end)
|
||||
{
|
||||
addr = linux_end;
|
||||
if (addr >= end)
|
||||
if (addr + size >= end)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue