From patchwork Mon Sep 5 21:07:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 1125482 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p85L7ekm019804 for ; Mon, 5 Sep 2011 21:07:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752209Ab1IEVHj (ORCPT ); Mon, 5 Sep 2011 17:07:39 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:33602 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752093Ab1IEVHj (ORCPT ); Mon, 5 Sep 2011 17:07:39 -0400 Received: from [12.139.69.140] (helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1R0gOH-0008IA-P5; Mon, 05 Sep 2011 21:07:38 +0000 From: Colin King To: Len Brown , linux-acpi@vger.kernel.org Subject: [PATCH] ACPI, APEI, fix ERST table size checking Date: Mon, 5 Sep 2011 14:07:36 -0700 Message-Id: <1315256856-14170-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.4.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 05 Sep 2011 21:07:40 +0000 (UTC) From: Colin Ian King Check ERST size against acpi_table_erst rather than acpi_table_einj. The original code just so happened to work because the ERST and EINJ headers are the same size. Signed-off-by: Colin Ian King --- drivers/acpi/apei/erst.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c index 2ca59dc..5f6153e 100644 --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c @@ -917,7 +917,7 @@ static int erst_check_table(struct acpi_table_erst *erst_tab) { if ((erst_tab->header_length != (sizeof(struct acpi_table_erst) - sizeof(erst_tab->header))) - && (erst_tab->header_length != sizeof(struct acpi_table_einj))) + && (erst_tab->header_length != sizeof(struct acpi_table_erst))) return -EINVAL; if (erst_tab->header.length < sizeof(struct acpi_table_erst)) return -EINVAL;