Received: from eggs.gnu.org ([2001:4830:134:3::10]:44313) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfMAs-0001qt-Ow for qemu-devel@nongnu.org; Fri, 25 Sep 2015 02:08:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfMAo-00082F-09 for qemu-devel@nongnu.org; Fri, 25 Sep 2015 02:08:02 -0400 From: Markus Armbruster References: <1443121042-3409-1-git-send-email-armbru@redhat.com> <1443121042-3409-7-git-send-email-armbru@redhat.com> <20150924192551.GC30243@thinpad.lan.raisama.net> Date: Fri, 25 Sep 2015 08:07:54 +0200 In-Reply-To: <20150924192551.GC30243@thinpad.lan.raisama.net> (Eduardo Habkost's message of "Thu, 24 Sep 2015 16:25:51 -0300") Message-ID: <87mvwb58w5.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v3 6/7] qdev: Protect device-list-properties against broken devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Peter Maydell , thuth@redhat.com, Peter Crosthwaite , qemu-devel@nongnu.org, qemu-stable@nongnu.org, Christian Borntraeger , Alexander Graf , qemu-ppc@nongnu.org, Antony Pavlov , stefanha@redhat.com, Cornelia Huck , Paolo Bonzini , Alistair Francis , afaerber@suse.de, Li Guang , Richard Henderson Eduardo Habkost writes: > On Thu, Sep 24, 2015 at 08:57:21PM +0200, Markus Armbruster wrote: > [...] >> diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c >> index ff249af..7692090 100644 >> --- a/hw/arm/allwinner-a10.c >> +++ b/hw/arm/allwinner-a10.c >> @@ -103,6 +103,8 @@ static void aw_a10_class_init(ObjectClass *oc, void *data) >> DeviceClass *dc = DEVICE_CLASS(oc); >> >> dc->realize = aw_a10_realize; >> + /* Reason: creates a CPU, thus use after free(), see cpu_class_init() */ >> + dc->cannot_even_create_with_object_new_yet = true; > > The comments at aw_a10_class_init(), digic_class_init(), > fsl_imx25_class_init(), fsl_imx31_class_init(), and > xlnx_zynqmp_class_init() are now outdated, as cpu_class_init() doesn't > set cannot_even_create_with_object_new_yet anymore. > > We could do this: > * Update the comments to "Reason: creates an ARM CPU, thus use after > free(), see arm_cpu_class_init()" Yes. > * Add a note at arm_cpu_class_init() saying that we can probably > unset cannot_even_create_with_object_new_yet in those functions > once we fix TYPE_ARM_CPU Okay. Thanks!