summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/core/runtime.c
diff options
context:
space:
mode:
authorMichael Brown2012-01-18 01:02:16 +0100
committerMichael Brown2012-01-18 01:02:16 +0100
commitf5bbe7ec4a4b31ad197947b025c54a8e87402436 (patch)
treeb3d902ef93ee3e72210c50d4ca7f682ba14ba6a9 /src/arch/i386/core/runtime.c
parent[test] Add self-tests for SHA-1 algorithm (diff)
downloadipxe-f5bbe7ec4a4b31ad197947b025c54a8e87402436.tar.gz
ipxe-f5bbe7ec4a4b31ad197947b025c54a8e87402436.tar.xz
ipxe-f5bbe7ec4a4b31ad197947b025c54a8e87402436.zip
[lkrnprefix] Copy command line before installing iPXE
The command line may be situated in an area of base memory that will be overwritten by iPXE's real-mode segments, causing the command line to be corrupted before it can be used. Fix by creating a copy of the command line on the prefix stack (below 0x7c00) before installing the real-mode segments. Reported-by: Dave Hansen <dave@sr71.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/i386/core/runtime.c')
-rw-r--r--src/arch/i386/core/runtime.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/arch/i386/core/runtime.c b/src/arch/i386/core/runtime.c
index 09ba6256..2ad8c20a 100644
--- a/src/arch/i386/core/runtime.c
+++ b/src/arch/i386/core/runtime.c
@@ -132,7 +132,8 @@ static int cmdline_init ( void ) {
}
cmdline = cmdline_copy;
copy_from_user ( cmdline, cmdline_user, 0, len );
- DBGC ( colour, "RUNTIME found command line \"%s\"\n", cmdline );
+ DBGC ( colour, "RUNTIME found command line \"%s\" at %08x\n",
+ cmdline, cmdline_phys );
/* Strip unwanted cruft from the command line */
cmdline_strip ( cmdline, "BOOT_IMAGE=" );