瀏覽代碼

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 年之前
父節點
當前提交
78dd963c1f
共有 1 個檔案被更改,包括 5 行新增0 行删除
  1. 5
    0
      src/arch/i386/firmware/pcbios/e820mangler.S

+ 5
- 0
src/arch/i386/firmware/pcbios/e820mangler.S 查看文件

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

Loading…
取消
儲存