Skip to content

Commit

Permalink
x86, efi: Check table header length in efi_bgrt_init()
Browse files Browse the repository at this point in the history
Header length should be validated for all ACPI tables before accessing
any non-header field.

Signed-off-by: Jan Beulich <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Acked-by: Matt Fleming <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
  • Loading branch information
jbeulich authored and H. Peter Anvin committed Nov 14, 2012
1 parent 89d1666 commit 5d6d578
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/x86/platform/efi/efi-bgrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ void efi_bgrt_init(void)
if (ACPI_FAILURE(status))
return;

if (bgrt_tab->header.length < sizeof(*bgrt_tab))
return;
if (bgrt_tab->version != 1)
return;
if (bgrt_tab->image_type != 0 || !bgrt_tab->image_address)
Expand Down

0 comments on commit 5d6d578

Please sign in to comment.