Received: from eggs.gnu.org ([2001:4830:134:3::10]:54268) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGH3S-0008Fd-3R for qemu-devel@nongnu.org; Mon, 04 Jan 2016 21:08:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGH3N-0004Ra-4Y for qemu-devel@nongnu.org; Mon, 04 Jan 2016 21:08:58 -0500 From: Programmingkid Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Mon, 4 Jan 2016 21:08:49 -0500 Message-Id: Mime-Version: 1.0 (Apple Message framework v1084) Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] macio: fix overflow in lba to offset conversion for ATAPI devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland Cc: "qemu-ppc@nongnu.org list:PowerPC" , qemu-devel qemu-devel > As the IDEState lba field is an int32_t, make sure we cast to int64_t = before > shifting to calculate the offset. Otherwise we end up with an overflow = when > trying to access sectors beyond 2GB as can occur when using DVD = images. >=20 > Signed-off-by: Mark Cave-Ayland > --- > hw/ide/macio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/hw/ide/macio.c b/hw/ide/macio.c > index 3ee962f..a78b6e0 100644 > --- a/hw/ide/macio.c > +++ b/hw/ide/macio.c > @@ -280,7 +280,7 @@ static void pmac_ide_atapi_transfer_cb(void = *opaque, int=20 > ret) > } > =20 > /* Calculate current offset */ > - offset =3D (int64_t)(s->lba << 11) + s->io_buffer_index; > + offset =3D ((int64_t)(s->lba) << 11) + s->io_buffer_index; > =20 > pmac_dma_read(s->blk, offset, io->len, = pmac_ide_atapi_transfer_cb, io); > return; > --=20 > 1.7.10.4 It worked, but the first time I tried it, Mac OS 10.4.0 had a kernel = panic. The AppleADBKeyboard.kext was the cause. The second time it = booted to the installer.=20 Reviewed-by: John Arbuckle