Parcourir la source

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 il y a 18 ans
Parent
révision
78dd963c1f
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5
    0
      src/arch/i386/firmware/pcbios/e820mangler.S

+ 5
- 0
src/arch/i386/firmware/pcbios/e820mangler.S Voir le fichier

@@ -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

Chargement…
Annuler
Enregistrer