bootsect: zero memory above a chainloaded boot sector/NBP
authorH. Peter Anvin <hpa@zytor.com>
Sun, 14 Jun 2009 21:32:42 +0000 (14:32 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Sun, 14 Jun 2009 21:32:42 +0000 (14:32 -0700)
Windows RIS has been reported to make inappropriate use of data found
in uninitialized memory.  To avoid that, clear memory between
a chainloaded boot sector or NBP and Free Base Memory.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
NEWS
core/bootsect.inc
version

diff --git a/NEWS b/NEWS
index 5a18525..2ab5946 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ Starting with 1.47, changes marked with SYSLINUX, PXELINUX, ISOLINUX
 or EXTLINUX apply to that specific program only; other changes apply
 to all derivatives.
 
+Changes in 3.83:
+       * PXELINUX: clear memory before handing over to a chainloaded
+         NBP.  This may help avoid a bug in Windows RIS.
+
 Changes in 3.82:
        * isohybrid: fix the -partok logic for loading from a partition.
        * ISOLINUX: deal with systems which return from INT 13h with
index b107eb5..3ea36bf 100644 (file)
@@ -84,11 +84,20 @@ load_bootsec:
 
 ;
 ; replace_bootstrap for the special case where we have exactly one
-; descriptor.
+; descriptor, based in low memory.  We will generate a second descriptor
+; to clear remaining FBM.
 ;
 
 replace_bootstrap_one:
-               push word 1                     ; Length of descriptor list
+               mov eax,[trackbuf]              ; Base address
+               add eax,[trackbuf+8]            ; Length
+               movzx edx,word [BIOS_fbm]
+               shl edx,10                      ; Free Base Memory
+               sub edx,eax
+               mov [trackbuf+12],eax
+               or dword [trackbuf+16],-1       ; Zero memory
+               mov [trackbuf+20],edx
+               push word 2                     ; Length of descriptor list
                ; Fall through
 
 ;
diff --git a/version b/version
index 2fc9418..f2649fb 100644 (file)
--- a/version
+++ b/version
@@ -1 +1 @@
-3.82 2009
+3.83 2009