x86/efi: Include a .bss section within the PE/COFF headers
authorMichael Brown <mbrown@fensystems.co.uk>
Thu, 10 Jul 2014 11:26:20 +0000 (12:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Jul 2014 15:08:28 +0000 (08:08 -0700)
commit25dfab58f7aa6fe6ca9c5d4c545a80d5c6f95fb9
treea4c7af9bfe855c1a41aba8722a6d3ef1f70b7932
parented2195e6289fde88c6dad50c9ddaef56fe9ef828
x86/efi: Include a .bss section within the PE/COFF headers

commit c7fb93ec51d462ec3540a729ba446663c26a0505 upstream.

The PE/COFF headers currently describe only the initialised-data
portions of the image, and result in no space being allocated for the
uninitialised-data portions.  Consequently, the EFI boot stub will end
up overwriting unexpected areas of memory, with unpredictable results.

Fix by including a .bss section in the PE/COFF headers (functionally
equivalent to the init_size field in the bzImage header).

Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
Cc: Thomas Bächler <thomas@archlinux.org>
Cc: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/boot/header.S
arch/x86/boot/tools/build.c