]> Git Repo - linux.git/commitdiff
x86, efi: Check table header length in efi_bgrt_init()
authorJan Beulich <[email protected]>
Wed, 7 Nov 2012 16:46:08 +0000 (16:46 +0000)
committerH. Peter Anvin <[email protected]>
Wed, 14 Nov 2012 16:49:34 +0000 (08:49 -0800)
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]>
arch/x86/platform/efi/efi-bgrt.c

index f6a0c1b8e518f91ef4992be10a3091e514cc5a50..d9c1b95af17c1ead797783eed225c94c9aa7fe5f 100644 (file)
@@ -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)
This page took 0.045587 seconds and 4 git commands to generate.