comboot.inc: vk_append is a field in a struct, not an address
authorH. Peter Anvin <hpa@linux.intel.com>
Fri, 2 Jul 2010 00:59:30 +0000 (17:59 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Fri, 2 Jul 2010 01:01:58 +0000 (18:01 -0700)
We want to use VKernelBuf as temporary storage, not vk_append.
vk_append is an offset into a larger buffer, and we ended up
corrupting low BIOS memory.

Reported-by: Joseph Cihula <joseph.cihula@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
core/comboot.inc

index 65b20be..59db7ec 100644 (file)
@@ -1,7 +1,7 @@
 ;; -----------------------------------------------------------------------
 ;;
 ;;   Copyright 1994-2009 H. Peter Anvin - All Rights Reserved
-;;   Copyright 2009 Intel Corporation; author: H. Peter Anvin
+;;   Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
 ;;
 ;;   This program is free software; you can redistribute it and/or modify
 ;;   it under the terms of the GNU General Public License as published by
@@ -753,11 +753,11 @@ comapi_runkernel:
                ; It's not just possible, but quite likely, that ES:BX
                ; points into real_mode_seg or xfer_buf_seg, so we
                ; need to exercise some special care here... use
-               ; vk_append for temporary storage.
+               ; VKernelBuf for temporary storage.
                push ds
                mov ds,P_ES
                mov si,P_BX
-               mov di,vk_append
+               mov di,VKernelBuf
                call strcpy
                pop ds
 
@@ -786,7 +786,7 @@ comapi_runkernel:
                push es
                mov dx,real_mode_seg
                mov es,dx
-               mov si,vk_append
+               mov si,VKernelBuf
                mov di,cmd_line_here
                call strcpy
                mov word [es:di-1],' '  ; Simulate APPEND: space plus null