From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwvs6-0002uG-9R for qemu-devel@nongnu.org; Thu, 12 Nov 2015 12:41:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zwvs3-0003Tt-3m for qemu-devel@nongnu.org; Thu, 12 Nov 2015 12:41:18 -0500 Received: from mx2.suse.de ([195.135.220.15]:39147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwvs2-0003TX-TS for qemu-devel@nongnu.org; Thu, 12 Nov 2015 12:41:15 -0500 References: <1425478186-18894-1-git-send-email-ild@inbox.ru> <87io83jvug.fsf@blackfin.pond.sub.org> <87wptohq5k.fsf@blackfin.pond.sub.org> From: =?UTF-8?Q?Andreas_F=c3=a4rber?= Message-ID: <5644CF37.8060801@suse.de> Date: Thu, 12 Nov 2015 18:41:11 +0100 MIME-Version: 1.0 In-Reply-To: <87wptohq5k.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] include/hw: field 'offset' in struct Property should be ptrdiff_t as int causes overflow List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Peter Maydell , Ildar Isaev , QEMU Developers , Anthony Liguori Am 11.11.2015 um 09:54 schrieb Markus Armbruster: > Peter Maydell writes: >> On 25 August 2015 at 15:17, Markus Armbruster wrot= e: >>> Stumbled over this while throwing away old mail. Andreas, what do yo= u >>> think? >> >> Seems right to me -- I suspect the original properties code was >> written with the assumption that the property field would be >> inside the device struct (and so offsets are small). The array >> properties code breaks that assumption by allocating a separate >> lump of memory with the properties in it; so now there's no >> guarantee that the two pointers being subtracted will be >> within 4G of each other. >> >> Reviewed-by: Peter Maydell >> >> Arguably for consistency the 'arrayoffset' struct member should >> also be a ptrdiff_t, though our current uses of it are such >> that it'll always be within int range. >=20 > Andreas? Found it archived. I honestly don't think it's necessary in practice to have 64-bit offsets on 64-bit host, but it builds okay, queued. Testing got stuck in ahci though, investigating. Thanks, Andreas --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Felix Imend=F6rffer, Jane Smithard, Graham Norton; HRB 21284 (AG N=FC= rnberg)