Bläddra i källkod

Check to see if we've reached the end of the map before attempting to

skip past an empty region, otherwise we end up generating an infinitely
long e820 map.  (Yes, there *are* real systems that provide e820 maps
with a zero-length region at the end...)
tags/v0.9.3
Michael Brown 18 år sedan
förälder
incheckning
78dd963c1f
1 ändrade filer med 5 tillägg och 0 borttagningar
  1. 5
    0
      src/arch/i386/firmware/pcbios/e820mangler.S

+ 5
- 0
src/arch/i386/firmware/pcbios/e820mangler.S Visa fil

@@ -361,7 +361,12 @@ int15_e820:
361 361
 	pushl	%edx	
362 362
 	call	split_e820
363 363
 	pushfw
364
+	/* Skip empty region checking if we've reached the end of the
365
+	 * map or hit an error, to avoid a potential endless loop.
366
+	 */
364 367
 	jc	1f
368
+	testl	%ebx, %ebx
369
+	jz	1f
365 370
 	/* Check for an empty region */
366 371
 	pushl	%eax
367 372
 	movl	%es:8(%di), %eax

Laddar…
Avbryt
Spara