From patchwork Fri Aug 20 19:26:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 120673 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7KJRPwx019193 for ; Fri, 20 Aug 2010 19:27:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751162Ab0HTT1Z (ORCPT ); Fri, 20 Aug 2010 15:27:25 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]:28552 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751050Ab0HTT1Y (ORCPT ); Fri, 20 Aug 2010 15:27:24 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o7KJR7iX026637 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 20 Aug 2010 19:27:09 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o7KIrkfI018268; Fri, 20 Aug 2010 19:27:06 GMT Received: from abhmt010.oracle.com by acsmt355.oracle.com with ESMTP id 517418721282332366; Fri, 20 Aug 2010 12:26:06 -0700 Received: from [129.146.51.160] (/129.146.51.160) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 20 Aug 2010 12:26:05 -0700 Message-ID: <4C6ED6CD.4010002@kernel.org> Date: Fri, 20 Aug 2010 12:26:05 -0700 From: Yinghai Lu User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100714 SUSE/3.0.6 Thunderbird/3.0.6 MIME-Version: 1.0 To: Huang Ying CC: Jin Dongming , Randy Dunlap , Stephen Rothwell , Andi Kleen , Hidetoshi Seto , ACPI , LKLM Subject: Re: [PATCH 1/4] [Patch-next] ACPI, APEI, ERST Fix the wrong checking of Serialization Header's length References: <4C69DDB5.6060103@np.css.fujitsu.com> <1282008836.2744.1490.camel@yhuang-dev> <4C69F094.1040607@np.css.fujitsu.com> <1282015344.2744.1500.camel@yhuang-dev> <4C6A139D.20507@np.css.fujitsu.com> <1282109696.2744.1553.camel@yhuang-dev> In-Reply-To: <1282109696.2744.1553.camel@yhuang-dev> 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.3 (demeter.kernel.org [140.211.167.41]); Fri, 20 Aug 2010 19:27:26 +0000 (UTC) Index: linux-2.6/drivers/acpi/apei/einj.c =================================================================== --- linux-2.6.orig/drivers/acpi/apei/einj.c +++ linux-2.6/drivers/acpi/apei/einj.c @@ -426,7 +426,8 @@ DEFINE_SIMPLE_ATTRIBUTE(error_inject_fop static int einj_check_table(struct acpi_table_einj *einj_tab) { - if (einj_tab->header_length != sizeof(struct acpi_table_einj)) + if (einj_tab->header_length != + (sizeof(struct acpi_table_einj) - sizeof(einj_tab->header))) return -EINVAL; if (einj_tab->header.length < sizeof(struct acpi_table_einj)) return -EINVAL; Index: linux-2.6/drivers/acpi/apei/erst.c =================================================================== --- linux-2.6.orig/drivers/acpi/apei/erst.c +++ linux-2.6/drivers/acpi/apei/erst.c @@ -750,7 +750,8 @@ __setup("erst_disable", setup_erst_disab static int erst_check_table(struct acpi_table_erst *erst_tab) { - if (erst_tab->header_length != sizeof(struct acpi_table_erst)) + if (erst_tab->header_length != + (sizeof(struct acpi_table_erst) - sizeof(erst_tab->header))) return -EINVAL; if (erst_tab->header.length < sizeof(struct acpi_table_erst)) return -EINVAL;