소스 검색

[efi] Fix uninitialised data in HII IFR structures

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>
tags/v1.20.1
Michael Brown 8 년 전
부모
커밋
c9f6a86059
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1
    0
      src/interface/efi/efi_hii.c

+ 1
- 0
src/interface/efi/efi_hii.c 파일 보기

@@ -117,6 +117,7 @@ static void * efi_ifr_op ( struct efi_ifr_builder *ifr, unsigned int opcode,
117 117
 	ifr->ops_len = new_ops_len;
118 118
 
119 119
 	/* Fill in opcode header */
120
+	memset ( op, 0, len );
120 121
 	op->OpCode = opcode;
121 122
 	op->Length = len;
122 123
 

Loading…
취소
저장