+ x86_64-fix-off-by-one-in-bad_addr-checking-in.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     x86_64: Fix off by one in bad_addr checking in find_e820_area

has been added to the -mm tree.  Its filename is

     x86_64-fix-off-by-one-in-bad_addr-checking-in.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: x86_64: Fix off by one in bad_addr checking in find_e820_area
From: Robert Hentosh <robert_hentosh@xxxxxxxx>


Actually, we just stumbled on a different bug found in find_e820_area() in
e820.c.  The following code does not handle the edge condition correctly:

   while (bad_addr(&addr, size) && addr+size < ei->addr + ei->size)
       ;
   last = addr + size;
   if ( last > ei->addr + ei->size )
       continue;

The second statement in the while loop needs to be a <= b so that it is the
logical negavite of the if (a > b) outside it.  It needs to read:

   while (bad_addr(&addr, size) && addr+size <= ei->addr + ei->size)
       ;

In the case that failed bad_addr was returning an address that is exactly size
bellow the end of the e820 range.

AK: Again together with the earlier avoid edma fix this fixes boot on a Dell
PE6850/16GB

Signed-off-by: Andi Kleen <ak@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/x86_64/kernel/e820.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN arch/x86_64/kernel/e820.c~x86_64-fix-off-by-one-in-bad_addr-checking-in arch/x86_64/kernel/e820.c
--- devel/arch/x86_64/kernel/e820.c~x86_64-fix-off-by-one-in-bad_addr-checking-in	2006-05-29 14:16:24.000000000 -0700
+++ devel-akpm/arch/x86_64/kernel/e820.c	2006-05-29 14:16:24.000000000 -0700
@@ -149,7 +149,7 @@ unsigned long __init find_e820_area(unsi
 			addr = start;
 		if (addr > ei->addr + ei->size) 
 			continue; 
-		while (bad_addr(&addr, size) && addr+size < ei->addr + ei->size)
+		while (bad_addr(&addr, size) && addr+size <= ei->addr+ei->size)
 			;
 		last = addr + size;
 		if (last > ei->addr + ei->size)
_

Patches currently in -mm which might be from robert_hentosh@xxxxxxxx are

x86_64-fix-off-by-one-in-bad_addr-checking-in.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux