From patchwork Tue Mar 30 08:20:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduard - Gabriel Munteanu X-Patchwork-Id: 89252 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2U8KlZe006243 for ; Tue, 30 Mar 2010 08:20:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755945Ab0C3IUj (ORCPT ); Tue, 30 Mar 2010 04:20:39 -0400 Received: from mail-bw0-f209.google.com ([209.85.218.209]:33744 "EHLO mail-bw0-f209.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755867Ab0C3IUa (ORCPT ); Tue, 30 Mar 2010 04:20:30 -0400 Received: by mail-bw0-f209.google.com with SMTP id 1so4153677bwz.21 for ; Tue, 30 Mar 2010 01:20:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :date:message-id:x-mailer:in-reply-to:references; bh=yMnBpPz4OiEZ/sFi+gZZhkrltAbe+I/31qpBZmlm/qk=; b=f2pz3M7vLkCWf23J/2RVsB3B8GakcrpZH04hNfUKKLFoUOz3toGV+Qtd8wVuZymbrK J6W7gcbPL3TL9qWVPCstsmqDr9uRIIy+1rbyfjqU+pRP9IIOMnc9IuNxL8KTprzEl505 120YNhutDHNAqolMeJmScKGgQ3B3ho+a+yu20= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=L4uLDIYyeI8NwUPqqX9WGXVFFt1wCqRxBHOmF5vaeeI4J9lpNZkvaRY+jWisBMKfmJ YTwjPuiv9f1Qy2vRFvAiQTR64XM1idbPA3DM3jDYUgoD2RiFqafif0+f7mKJ8Jle5qKP FtL97cNlaNRmL4LpHkoJ9H6/E+dQOEPuJyMCI= Received: by 10.204.146.148 with SMTP id h20mr7488175bkv.185.1269937229398; Tue, 30 Mar 2010 01:20:29 -0700 (PDT) Received: from localhost.localdomain ([188.25.93.130]) by mx.google.com with ESMTPS id 16sm2589620bwz.9.2010.03.30.01.20.28 (version=SSLv3 cipher=RC4-MD5); Tue, 30 Mar 2010 01:20:29 -0700 (PDT) From: Eduard - Gabriel Munteanu To: joro@8bytes.org Cc: aliguori@us.ibm.com, avi@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, Eduard - Gabriel Munteanu Subject: [RFC PATCH 7/7] acpi: fix bug in acpi_checksum() caused by garbage in checksum field Date: Tue, 30 Mar 2010 11:20:08 +0300 Message-Id: <7498607873ad7c9ff59d0a24d35391c0e4ba0a11.1269936879.git.eduard.munteanu@linux360.ro> X-Mailer: git-send-email 1.6.4.4 In-Reply-To: References: Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@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]); Tue, 30 Mar 2010 08:20:47 +0000 (UTC) diff --git a/hw/acpi.c b/hw/acpi.c index f067f85..bb015f3 100644 --- a/hw/acpi.c +++ b/hw/acpi.c @@ -832,11 +832,16 @@ size_t acpi_tables_len, acpi_tables_prev_len; static int acpi_checksum(const uint8_t *data, int len) { int sum, i; + struct acpi_table_header *acpi_hdr; sum = 0; for(i = 0; i < len; i++) sum += data[i]; + /* Ignore preexisting garbage in checksum. */ + acpi_hdr = (struct acpi_table_header *) data; + sum -= acpi_hdr->checksum; + return (-sum) & 0xff; }