mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [tip:core/efi] x86, efi: Check table header length in efi_bgrt_init()
       [not found] <509A9E6002000078000A7079@nat28.tlf.novell.com>
@ 2012-11-14 17:34 ` tip-bot for Jan Beulich
  0 siblings, 0 replies; only message in thread
From: tip-bot for Jan Beulich @ 2012-11-14 17:34 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, jbeulich, matt.fleming, JBeulich, tglx, hpa

Commit-ID:  5d6d578c170bb280db5d4779f666e456f4f82ec5
Gitweb:     http://git.kernel.org/tip/5d6d578c170bb280db5d4779f666e456f4f82ec5
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Wed, 7 Nov 2012 16:46:08 +0000
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Wed, 14 Nov 2012 08:49:34 -0800

x86, efi: Check table header length in efi_bgrt_init()

Header length should be validated for all ACPI tables before accessing
any non-header field.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Link: http://lkml.kernel.org/r/509A9E6002000078000A7079@nat28.tlf.novell.com
Acked-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/platform/efi/efi-bgrt.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/platform/efi/efi-bgrt.c b/arch/x86/platform/efi/efi-bgrt.c
index f6a0c1b..d9c1b95 100644
--- a/arch/x86/platform/efi/efi-bgrt.c
+++ b/arch/x86/platform/efi/efi-bgrt.c
@@ -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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-14 17:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <509A9E6002000078000A7079@nat28.tlf.novell.com>
2012-11-14 17:34 ` [tip:core/efi] x86, efi: Check table header length in efi_bgrt_init() tip-bot for Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome