[syslinux] [syslinux:master] isolinux: Clear upper half of EDX before using

Geert Stappers stappers at stappers.nl
Wed Dec 11 21:55:13 PST 2013


Commit-ID:  88d17d136c21b8afb7d27e091cbb1f757ded80df
Gitweb:     http://www.syslinux.org/commit/88d17d136c21b8afb7d27e091cbb1f757ded80df
Author:     H. Peter Anvin <hpa op zytor.com>
AuthorDate: Tue, 26 Nov 2013 09:58:17 -0800
Committer:  H. Peter Anvin <hpa op zytor.com>
CommitDate: Wed, 11 Dec 2013 18:04:04 -0800

isolinux: Clear upper half of EDX before using

In checkin:

    cb015497a4e4 isolinux: Update LBA in getlinsec loop

... we use EDX as a sector count, but the sector count is actually in
DX, and the upper half of EDX is uninitialized.  If the BIOS enters
with a nonzero value in the upper half of EDX, this breaks horribly.

At least one set of BIOSes has been identified where if the LBA > 64K
then the upper half of EDX will be nonzero.

Reported-by: Carl Duff <cdrw2400 op gmail.com>
Reported-by: Philip Müller <philm op manjaro.org>
Tested-by: Gerardo Exequiel Pozzi <vmlinuz386 op yahoo.com.ar>
Signed-off-by: H. Peter Anvin <hpa op zytor.com>

---
 core/isolinux.asm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/isolinux.asm b/core/isolinux.asm
index db6d2d4..dd0fa89 100644
--- a/core/isolinux.asm
+++ b/core/isolinux.asm
@@ -430,7 +430,7 @@ MaxLMA		equ 384*1024		; Reasonable limit (384K)
 		call getlinsec
 		pop eax
 		pop cx
-		mov dx,cx
+		movzx edx,cx
 		pop bp
 		pop bx
 
_______________________________________________
Syslinux-commits mailing list
Syslinux-commits op zytor.com
http://www.zytor.com/mailman/listinfo/syslinux-commits


Groeten
Geert Stappers
-- 
Leven en laten leven


More information about the Syslinux mailing list