From fd37475e9a5d969969efc811180e7f5e38dafce0 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 7 Nov 2007 09:26:10 -0800 Subject: [PATCH] Guard section to avoid future partial-sector-clobber issues 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. --- isolinux.asm | 4 +--- layout.inc | 9 ++++++++- parsecmd.inc | 2 +- parseconfig.inc | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/isolinux.asm b/isolinux.asm index 3ede48f..d0e56fc 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 4fa49bb..3070373 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 c19c658..3431497 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 ef1ed11..ab832b6 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 -- 2.7.4