diff options
author | Matt Fleming <matt@console-pimps.org> | 2014-04-08 16:14:00 +0400 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2014-04-11 00:19:52 +0400 |
commit | 7e8213c1f3acc064aef37813a39f13cbfe7c3ce7 (patch) | |
tree | 6a24e3cd7ca9994d165bd38e83567ab546d01a92 /arch/x86/boot/compressed/head_32.S | |
parent | 396f1a08db212138418b38f784e4bbe516d2fdb2 (diff) | |
download | linux-7e8213c1f3acc064aef37813a39f13cbfe7c3ce7.tar.xz |
x86/efi: Correct EFI boot stub use of code32_start
code32_start should point at the start of the protected mode code, and
*not* at the beginning of the bzImage. This is much easier to do in
assembly so document that callers of make_boot_params() need to fill out
code32_start.
The fallout from this bug is that we would end up relocating the image
but copying the image at some offset, resulting in what appeared to be
memory corruption.
Reported-by: Thomas Bächler <thomas@archlinux.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch/x86/boot/compressed/head_32.S')
-rw-r--r-- | arch/x86/boot/compressed/head_32.S | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S index de9d4200d305..cbed1407a5cd 100644 --- a/arch/x86/boot/compressed/head_32.S +++ b/arch/x86/boot/compressed/head_32.S @@ -59,6 +59,7 @@ ENTRY(efi_pe_entry) call make_boot_params cmpl $0, %eax je fail + movl %esi, BP_code32_start(%eax) popl %ecx pushl %eax pushl %ecx @@ -90,12 +91,7 @@ fail: hlt jmp fail 2: - call 3f -3: - popl %eax - subl $3b, %eax - subl BP_pref_address(%esi), %eax - add BP_code32_start(%esi), %eax + movl BP_code32_start(%esi), %eax leal preferred_addr(%eax), %eax jmp *%eax |