From patchwork Sat Mar 14 01:11:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 11967 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2E1MQwB001976 for ; Sat, 14 Mar 2009 01:22:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755374AbZCNBVe (ORCPT ); Fri, 13 Mar 2009 21:21:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754981AbZCNBVe (ORCPT ); Fri, 13 Mar 2009 21:21:34 -0400 Received: from kroah.org ([198.145.64.141]:35832 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755201AbZCNBVc (ORCPT ); Fri, 13 Mar 2009 21:21:32 -0400 Received: from localhost (c-76-105-230-205.hsd1.or.comcast.net [76.105.230.205]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by coco.kroah.org (Postfix) with ESMTPSA id D3901491B8; Fri, 13 Mar 2009 18:21:28 -0700 (PDT) X-Mailbox-Line: From gregkh@mini.kroah.org Fri Mar 13 18:10:47 2009 Message-Id: <20090314011047.425424026@mini.kroah.org> User-Agent: quilt/0.48-1 Date: Fri, 13 Mar 2009 18:11:25 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org, Len Brown Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, linux-acpi@vger.kernel.org, Lin Ming , Henrique de Moraes Holschuh Subject: [patch 108/114] ACPI: fix broken usage of name.ascii References: <20090314010937.416083662@mini.kroah.org> Content-Disposition: inline; filename=acpi-fix-broken-usage-of-name.ascii.patch Lines: 36 In-Reply-To: <20090314011649.GA26170@kroah.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 2.6.28-stable review patch. If anyone has any objections, please let us know. ------------------ From: Henrique de Moraes Holschuh This issue was fixed indirectly in mainline by commit 0175d562a29ad052c510782c7e76bc63d5155b9b. acpi_namespace_node's name.ascii field is four chars, and not NULL- terminated except by pure luck. So, it cannot be used by sscanf() without a length restriction. This is the minimal fix for both stable 2.6.27 and 2.6.28. Signed-off-by: Henrique de Moraes Holschuh Cc: Lin Ming Cc: Len Brown Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/ec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -759,9 +759,10 @@ acpi_ec_register_query_methods(acpi_hand struct acpi_namespace_node *node = handle; struct acpi_ec *ec = context; int value = 0; - if (sscanf(node->name.ascii, "_Q%x", &value) == 1) { + + if (sscanf(node->name.ascii, "_Q%2x", &value) == 1) acpi_ec_add_query_handler(ec, value, handle, NULL, NULL); - } + return AE_OK; }