Re: [Qemu-devel] Use-after-free during unrealize in system_reset

2014-06-11 Thread Bandan Das
Andreas Färber writes: > Am 09.06.2014 19:02, schrieb Bandan Das: >> Paolo Bonzini writes: >> >>> Il 08/06/2014 12:46, Michael S. Tsirkin ha scritto: Tested-by: Michael S. Tsirkin >>> >>> You probably tested the reversal, actually. :) >>> >>> Actually, there is a reason for it. "Unassemb

Re: [Qemu-devel] Use-after-free during unrealize in system_reset

2014-06-11 Thread Paolo Bonzini
Il 11/06/2014 14:03, Andreas Färber ha scritto: Still, isn't this an indication that devices relied on the PCI bus bug of not unrealizing its state all the time and we may need to go back as far as ~1.7 (the initial finalize based fix) for resolving it? No, I don't think so. The devices rely o

Re: [Qemu-devel] Use-after-free during unrealize in system_reset

2014-06-11 Thread Andreas Färber
Am 09.06.2014 19:02, schrieb Bandan Das: > Paolo Bonzini writes: > >> Il 08/06/2014 12:46, Michael S. Tsirkin ha scritto: >>> Tested-by: Michael S. Tsirkin >> >> You probably tested the reversal, actually. :) >> >> Actually, there is a reason for it. "Unassembling" the device >> (unparent) shou

Re: [Qemu-devel] Use-after-free during unrealize in system_reset

2014-06-09 Thread Bandan Das
Paolo Bonzini writes: > Il 08/06/2014 12:46, Michael S. Tsirkin ha scritto: >> Tested-by: Michael S. Tsirkin > > You probably tested the reversal, actually. :) > > Actually, there is a reason for it. "Unassembling" the device > (unparent) should come after "powering it down" (unrealize). Yes,

Re: [Qemu-devel] Use-after-free during unrealize in system_reset

2014-06-09 Thread Michael S. Tsirkin
On Mon, Jun 09, 2014 at 09:51:56AM +0200, Paolo Bonzini wrote: > Il 08/06/2014 16:52, Michael S. Tsirkin ha scritto: > >On Sun, Jun 08, 2014 at 04:40:56PM +0200, Paolo Bonzini wrote: > >>Il 08/06/2014 12:46, Michael S. Tsirkin ha scritto: > >>>Tested-by: Michael S. Tsirkin > >> > >>You probably te

Re: [Qemu-devel] Use-after-free during unrealize in system_reset

2014-06-09 Thread Paolo Bonzini
Il 08/06/2014 16:52, Michael S. Tsirkin ha scritto: On Sun, Jun 08, 2014 at 04:40:56PM +0200, Paolo Bonzini wrote: Il 08/06/2014 12:46, Michael S. Tsirkin ha scritto: Tested-by: Michael S. Tsirkin You probably tested the reversal, actually. :) Actually, there is a reason for it. "Unassembl

Re: [Qemu-devel] Use-after-free during unrealize in system_reset

2014-06-08 Thread Michael S. Tsirkin
On Sun, Jun 08, 2014 at 04:40:56PM +0200, Paolo Bonzini wrote: > Il 08/06/2014 12:46, Michael S. Tsirkin ha scritto: > >Tested-by: Michael S. Tsirkin > > You probably tested the reversal, actually. :) > > Actually, there is a reason for it. "Unassembling" the device > (unparent) should come aft

Re: [Qemu-devel] Use-after-free during unrealize in system_reset

2014-06-08 Thread Michael S. Tsirkin
On Sun, Jun 08, 2014 at 04:40:56PM +0200, Paolo Bonzini wrote: > Il 08/06/2014 12:46, Michael S. Tsirkin ha scritto: > >Tested-by: Michael S. Tsirkin > > You probably tested the reversal, actually. :) I guess so, maybe patch asked me about it. > Actually, there is a reason for it. "Unassemblin

Re: [Qemu-devel] Use-after-free during unrealize in system_reset

2014-06-08 Thread Paolo Bonzini
Il 08/06/2014 12:46, Michael S. Tsirkin ha scritto: Tested-by: Michael S. Tsirkin You probably tested the reversal, actually. :) Actually, there is a reason for it. "Unassembling" the device (unparent) should come after "powering it down" (unrealize). However, the bus is missing a recursive

Re: [Qemu-devel] Use-after-free during unrealize in system_reset

2014-06-08 Thread Michael S. Tsirkin
On Fri, Jun 06, 2014 at 11:52:46AM +0200, Paolo Bonzini wrote: > Il 06/06/2014 11:03, Stefan Hajnoczi ha scritto: > >commit 5c21ce77d7e5643089ceec556c0408445d017f32 > >Author: Bandan Das > >Date: Wed Mar 12 21:02:12 2014 +0100 > > > >qdev: Realize buses on device realization > > > >Integ

Re: [Qemu-devel] Use-after-free during unrealize in system_reset

2014-06-06 Thread Paolo Bonzini
Il 06/06/2014 11:03, Stefan Hajnoczi ha scritto: commit 5c21ce77d7e5643089ceec556c0408445d017f32 Author: Bandan Das Date: Wed Mar 12 21:02:12 2014 +0100 qdev: Realize buses on device realization Integrate (un)realization of child buses with realization/unrealization of the device

Re: [Qemu-devel] Use-after-free during unrealize in system_reset

2014-06-06 Thread Stefan Hajnoczi
On Thu, Jun 5, 2014 at 6:18 PM, Michael S. Tsirkin wrote: > On Thu, Jun 05, 2014 at 05:31:45PM +0200, Stefan Hajnoczi wrote: >> qemu-iotests ./check -qcow2 067 is entering an infinite loop during >> system_reset. This failure is a non-deterministic use-after-free and >> the infinite loop happens

Re: [Qemu-devel] Use-after-free during unrealize in system_reset

2014-06-05 Thread Michael S. Tsirkin
On Thu, Jun 05, 2014 at 05:31:45PM +0200, Stefan Hajnoczi wrote: > qemu-iotests ./check -qcow2 067 is entering an infinite loop during > system_reset. This failure is a non-deterministic use-after-free and > the infinite loop happens maybe 1/3 of the time. This patch makes it fail deterministical

[Qemu-devel] Use-after-free during unrealize in system_reset

2014-06-05 Thread Stefan Hajnoczi
qemu-iotests ./check -qcow2 067 is entering an infinite loop during system_reset. This failure is a non-deterministic use-after-free and the infinite loop happens maybe 1/3 of the time. Michael Tsirkin found that pci_unregister_device() is called before pci_find_capability_list() since the parent