]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[efi] Fix uninitialised data in HII IFR structures
authorMichael Brown <mcb30@ipxe.org>
Wed, 29 Jun 2016 14:13:35 +0000 (15:13 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 29 Jun 2016 14:17:12 +0000 (15:17 +0100)
The HII IFR structures are allocated via realloc() rather than
zalloc(), and so are not automatically zeroed.  This results in the
presence of uninitialised and invalid data, causing crashes elsewhere
in the UEFI firmware.

Fix by explicitly zeroing the newly allocated portion of any IFR
structure in efi_ifr_op().

Debugged-by: Laszlo Ersek <lersek@redhat.com>
Debugged-by: Gary Lin <glin@suse.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/interface/efi/efi_hii.c

index 0ea970e67f666a000aae0fa98ac16a02c8a6ffb4..506fc886995ca6bac697e28fc68e4953765882fe 100644 (file)
@@ -117,6 +117,7 @@ static void * efi_ifr_op ( struct efi_ifr_builder *ifr, unsigned int opcode,
        ifr->ops_len = new_ops_len;
 
        /* Fill in opcode header */
+       memset ( op, 0, len );
        op->OpCode = opcode;
        op->Length = len;