From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39721 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFpL2-0001VZ-TJ for qemu-devel@nongnu.org; Sat, 22 May 2010 10:06:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFpL0-0001Dt-W5 for qemu-devel@nongnu.org; Sat, 22 May 2010 10:06:04 -0400 Received: from hall.aurel32.net ([88.191.82.174]:40690) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFpL0-0001Dk-8w for qemu-devel@nongnu.org; Sat, 22 May 2010 10:06:02 -0400 Date: Sat, 22 May 2010 16:05:47 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] lsi: Fix value overflow in request tag processing Message-ID: <20100522140547.GA5001@volta.aurel32.net> References: <20100521154926.GA22706@hall.aurel32.net> <20100521161736.GA27745@hall.aurel32.net> <4BF6B25B.7080508@siemens.com> <4BF6B36A.8070702@aurel32.net> <4BF6B88B.4060008@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <4BF6B88B.4060008@siemens.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: "qemu-devel@nongnu.org" On Fri, May 21, 2010 at 06:44:59PM +0200, Jan Kiszka wrote: > 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 Thanks for the quick patch, I have applied it. > --- > 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); > -- > 1.6.0.2 > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net