From patchwork Fri May 21 16:44:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 53193 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5F78EB7D30 for ; Sat, 22 May 2010 03:12:35 +1000 (EST) Received: from localhost ([127.0.0.1]:48042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFVlv-0003Nl-Tw for incoming@patchwork.ozlabs.org; Fri, 21 May 2010 13:12:32 -0400 Received: from [140.186.70.92] (port=33649 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFVLS-0004Qn-92 for qemu-devel@nongnu.org; Fri, 21 May 2010 12:45:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFVLQ-00072O-GU for qemu-devel@nongnu.org; Fri, 21 May 2010 12:45:10 -0400 Received: from thoth.sbs.de ([192.35.17.2]:21190) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFVLQ-00071s-7x for qemu-devel@nongnu.org; Fri, 21 May 2010 12:45:08 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id o4LGix3R014567; Fri, 21 May 2010 18:44:59 +0200 Received: from [139.25.109.167] (mchn012c.ww002.siemens.net [139.25.109.167] (may be forged)) by mail1.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o4LGixTU024179; Fri, 21 May 2010 18:44:59 +0200 Message-ID: <4BF6B88B.4060008@siemens.com> Date: Fri, 21 May 2010 18:44:59 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Aurelien Jarno References: <20100521154926.GA22706@hall.aurel32.net> <20100521161736.GA27745@hall.aurel32.net> <4BF6B25B.7080508@siemens.com> <4BF6B36A.8070702@aurel32.net> In-Reply-To: <4BF6B36A.8070702@aurel32.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: "qemu-devel@nongnu.org" Subject: [Qemu-devel] [PATCH] lsi: Fix value overflow in request tag processing X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This fixes a mismerge of 64d564094cac5f72eeaeb950c442b773a00d3586 (wrong patch version): We need to mask the tag value properly to obtain its device ID. Signed-off-by: Jan Kiszka --- hw/lsi53c895a.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c index 9d3c44d..f5a91ba 100644 --- a/hw/lsi53c895a.c +++ b/hw/lsi53c895a.c @@ -543,7 +543,7 @@ static void lsi_do_dma(LSIState *s, int out) return; } - id = s->current->tag >> 8; + id = (s->current->tag >> 8) & 0xf; dev = s->bus.devs[id]; if (!dev) { lsi_bad_selection(s, id); @@ -745,7 +745,7 @@ static void lsi_do_command(LSIState *s) s->sfbr = buf[0]; s->command_complete = 0; - id = s->select_tag >> 8; + id = (s->select_tag >> 8) & 0xf; dev = s->bus.devs[id]; if (!dev) { lsi_bad_selection(s, id);