[Qemu-devel] [PATCH] include/hw: field 'offset' in struct Property should be ptrdiff_t as int causes overflow

2015-03-04 Thread Ildar Isaev
'offset' field in struct Property is calculated as a diff between two pointers (hw/core/qdev-properties.c:802) arrayprop->prop.offset = eltptr - (void *)dev; If offset is declared as int, this subtraction can cause type overflow thus leading to the fall of the subsequent assert (hw/core/qdev-pr

Re: [Qemu-devel] [PATCH] include/hw: field 'offset' in struct Property should be ptrdiff_t as int causes overflow

2015-11-11 Thread Markus Armbruster
Peter Maydell writes: > On 25 August 2015 at 15:17, Markus Armbruster wrote: >> Stumbled over this while throwing away old mail. Andreas, what do you >> think? > > Seems right to me -- I suspect the original properties code was > written with the assumption that the property field would be > in

Re: [Qemu-devel] [PATCH] include/hw: field 'offset' in struct Property should be ptrdiff_t as int causes overflow

2015-11-12 Thread Andreas Färber
Am 11.11.2015 um 09:54 schrieb Markus Armbruster: > Peter Maydell writes: >> On 25 August 2015 at 15:17, Markus Armbruster wrote: >>> Stumbled over this while throwing away old mail. Andreas, what do you >>> think? >> >> Seems right to me -- I suspect the original properties code was >> written

Re: [Qemu-devel] [PATCH] include/hw: field 'offset' in struct Property should be ptrdiff_t as int causes overflow

2015-11-13 Thread John Snow
On 11/12/2015 12:41 PM, Andreas Färber wrote: > Am 11.11.2015 um 09:54 schrieb Markus Armbruster: >> Peter Maydell writes: >>> On 25 August 2015 at 15:17, Markus Armbruster wrote: Stumbled over this while throwing away old mail. Andreas, what do you think? >>> >>> Seems right to me -

Re: [Qemu-devel] [PATCH] include/hw: field 'offset' in struct Property should be ptrdiff_t as int causes overflow

2015-11-13 Thread Andreas Färber
Am 13.11.2015 um 19:32 schrieb John Snow: > On 11/12/2015 12:41 PM, Andreas Färber wrote: >> [...] Testing >> got stuck in ahci though, investigating. >> >> Thanks, >> Andreas >> > > Did you ever reproduce this, or does it seem to just be a race? Once I updated to a later git commit I was no long

Re: [Qemu-devel] [PATCH] include/hw: field 'offset' in struct Property should be ptrdiff_t as int causes overflow

2015-11-13 Thread John Snow
On 11/13/2015 01:36 PM, Andreas Färber wrote: > Am 13.11.2015 um 19:32 schrieb John Snow: >> On 11/12/2015 12:41 PM, Andreas Färber wrote: >>> [...] Testing >>> got stuck in ahci though, investigating. >>> >>> Thanks, >>> Andreas >>> >> >> Did you ever reproduce this, or does it seem to just be a

Re: [Qemu-devel] [PATCH] include/hw: field 'offset' in struct Property should be ptrdiff_t as int causes overflow

2015-08-25 Thread Markus Armbruster
Stumbled over this while throwing away old mail. Andreas, what do you think? Ildar Isaev writes: > 'offset' field in struct Property is calculated as a diff between two > pointers (hw/core/qdev-properties.c:802) > > arrayprop->prop.offset = eltptr - (void *)dev; > > If offset is declared as in

Re: [Qemu-devel] [PATCH] include/hw: field 'offset' in struct Property should be ptrdiff_t as int causes overflow

2015-08-25 Thread Peter Maydell
On 25 August 2015 at 15:17, Markus Armbruster wrote: > Stumbled over this while throwing away old mail. Andreas, what do you > 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 offs