From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxJ9M-0003Ny-I1 for qemu-devel@nongnu.org; Fri, 13 Nov 2015 13:32:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZxJ9H-0002NJ-OQ for qemu-devel@nongnu.org; Fri, 13 Nov 2015 13:32:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52675) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxJ9H-0002NB-Ie for qemu-devel@nongnu.org; Fri, 13 Nov 2015 13:32:35 -0500 References: <1425478186-18894-1-git-send-email-ild@inbox.ru> <87io83jvug.fsf@blackfin.pond.sub.org> <87wptohq5k.fsf@blackfin.pond.sub.org> <5644CF37.8060801@suse.de> From: John Snow Message-ID: <56462CC1.3010408@redhat.com> Date: Fri, 13 Nov 2015 13:32:33 -0500 MIME-Version: 1.0 In-Reply-To: <5644CF37.8060801@suse.de> 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: =?UTF-8?Q?Andreas_F=c3=a4rber?= , Markus Armbruster Cc: Peter Maydell , Ildar Isaev , QEMU Developers , Anthony Liguori On 11/12/2015 12:41 PM, Andreas F=E4rber wrote: > Am 11.11.2015 um 09:54 schrieb Markus Armbruster: >> Peter Maydell writes: >>> On 25 August 2015 at 15:17, Markus Armbruster wro= te: >>>> Stumbled over this while throwing away old mail. Andreas, what do y= ou >>>> 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. >> >> Andreas? >=20 > 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. >=20 > Thanks, > Andreas >=20 Did you ever reproduce this, or does it seem to just be a race?