summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-11-07 09:26:10 -0800
committerH. Peter Anvin <hpa@zytor.com>2007-11-07 09:26:10 -0800
commitfd37475e9a5d969969efc811180e7f5e38dafce0 (patch)
treeb203b78713cd89dc82cd3b9648b4bcc0a476c4d9
parentfe66201fedd68a163946635e5db2ad937178f136 (diff)
downloadsyslinux-fd37475e9a5d969969efc811180e7f5e38dafce0.tar.gz
Guard section to avoid future partial-sector-clobber issuessyslinux-3.53-pre3
Create a guard section .uibss that explicitly is covering the potential partial-sector-clobber zone, and contains items which are safe to assume will only be used after full image load.
-rw-r--r--isolinux.asm4
-rw-r--r--layout.inc9
-rw-r--r--parsecmd.inc2
-rw-r--r--parseconfig.inc2
4 files changed, 11 insertions, 6 deletions
diff --git a/isolinux.asm b/isolinux.asm
index 3ede48f6..d0e56fca 100644
--- a/isolinux.asm
+++ b/isolinux.asm
@@ -106,9 +106,7 @@ getcbuf resb trackbufsize
; ends at 4800h
; Some of these are touched before the whole image
- ; is loaded. DO NOT move this to .bss, since the beginning
- ; of .bss might be clobbered when loading the last fractional
- ; sector.
+ ; is loaded. DO NOT move this to .uibss.
section .bss1
alignb 4
ISOFileName resb 64 ; ISO filename canonicalization buffer
diff --git a/layout.inc b/layout.inc
index 4fa49bb3..30703739 100644
--- a/layout.inc
+++ b/layout.inc
@@ -58,7 +58,14 @@ STACK_START equ TEXT_START-STACK_SIZE
section .adv progbits align=1 follows=.config
- section .bss nobits align=16 follows=.adv
+ ; .uibss contains bss data which is guaranteed to be
+ ; safe to clobber during the loading of the image. This
+ ; is because while loading the primary image we will clobber
+ ; the spillover from the last fractional sector load.
+ section .uibss nobits align=16 follows=.adv
+
+ ; Normal bss...
+ section .bss nobits align=16 follows=.uibss
; Reserve space for stack
section .stack nobits align=16 start=STACK_START
diff --git a/parsecmd.inc b/parsecmd.inc
index c19c658c..34314976 100644
--- a/parsecmd.inc
+++ b/parsecmd.inc
@@ -96,7 +96,7 @@ getcommand:
err_badcfg db 'Unknown keyword in syslinux.cfg.', CR, LF, 0
err_noparm db 'Missing parameter in syslinux.cfg.', CR, LF, 0
- section .bss
+ section .uibss
alignb 4
vk_size equ (vk_end + 3) & ~3
VKernelBuf: resb vk_size ; "Current" vkernel
diff --git a/parseconfig.inc b/parseconfig.inc
index ef1ed112..ab832b6d 100644
--- a/parseconfig.inc
+++ b/parseconfig.inc
@@ -436,7 +436,7 @@ VKernel db 0 ; Have we seen any "label" statements?
IPAppend db 0 ; Default IPAPPEND option
%endif
- section .bss
+ section .uibss
alignb 4 ; For the good of REP MOVSD
command_line resb max_cmd_len+2 ; Command line buffer
alignb 4