From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMXBD-00040E-5t for qemu-devel@nongnu.org; Mon, 11 Jul 2016 05:07:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMXB9-00032O-TE for qemu-devel@nongnu.org; Mon, 11 Jul 2016 05:07:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47737) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMXB9-00032K-NK for qemu-devel@nongnu.org; Mon, 11 Jul 2016 05:07:03 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2ACCD8E3DE for ; Mon, 11 Jul 2016 09:07:03 +0000 (UTC) References: <1467991671-93391-1-git-send-email-pbonzini@redhat.com> From: Jason Wang Message-ID: <578361B2.3040608@redhat.com> Date: Mon, 11 Jul 2016 17:06:58 +0800 MIME-Version: 1.0 In-Reply-To: <1467991671-93391-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] net: cleanup before character devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= On 2016=E5=B9=B407=E6=9C=8808=E6=97=A5 23:27, Paolo Bonzini wrote: > Otherwise, vhost-user causes a use-after-free. > > Signed-off-by: Paolo Bonzini > --- > vl.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/vl.c b/vl.c > index d0b9ff9..005162d 100644 > --- a/vl.c > +++ b/vl.c > @@ -4327,9 +4327,6 @@ int main(int argc, char **argv, char **envp) > qemu_opts_del(icount_opts); > } > =20 > - /* clean up network at qemu process termination */ > - atexit(&net_cleanup); > - > if (default_net) { > QemuOptsList *net =3D qemu_find_opts("net"); > qemu_opts_set(net, NULL, "type", "nic", &error_abort); > @@ -4596,6 +4593,9 @@ int main(int argc, char **argv, char **envp) > #ifdef CONFIG_TPM > tpm_cleanup(); > #endif > + > + /* vhost-user must be cleaned up before chardevs. */ > + net_cleanup(); > qemu_chr_cleanup(); > =20 > return 0; Patch does not seems to be applied on master. Which tree is this patch=20 based? Thanks