Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LwMsl-0006Ma-L5 for qemu-devel@nongnu.org; Tue, 21 Apr 2009 16:47:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LwMsj-0006MB-Fc for qemu-devel@nongnu.org; Tue, 21 Apr 2009 16:47:54 -0400 Received: from [199.232.76.173] (port=48032 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LwMsj-0006M8-93 for qemu-devel@nongnu.org; Tue, 21 Apr 2009 16:47:53 -0400 Received: from savannah.gnu.org ([199.232.41.3]:33459 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LwMsi-00045r-T7 for qemu-devel@nongnu.org; Tue, 21 Apr 2009 16:47:53 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1LwMsi-00052W-7t for qemu-devel@nongnu.org; Tue, 21 Apr 2009 20:47:52 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1LwMsi-00052S-0N for qemu-devel@nongnu.org; Tue, 21 Apr 2009 20:47:52 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Tue, 21 Apr 2009 20:47:52 +0000 Subject: [Qemu-devel] [7205] net: Check device passed to host_net_remove (Jan Kiszka) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 7205 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7205 Author: aliguori Date: 2009-04-21 20:47:51 +0000 (Tue, 21 Apr 2009) Log Message: ----------- net: Check device passed to host_net_remove (Jan Kiszka) Make sure that we do not delete guest NICs via host_net_remove. Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori Modified Paths: -------------- branches/stable_0_10/net.c Modified: branches/stable_0_10/net.c =================================================================== --- branches/stable_0_10/net.c 2009-04-21 19:56:44 UTC (rev 7204) +++ branches/stable_0_10/net.c 2009-04-21 20:47:51 UTC (rev 7205) @@ -1854,14 +1854,20 @@ vlan = qemu_find_vlan(vlan_id); - for(vc = vlan->first_client; vc != NULL; vc = vc->next) - if (!strcmp(vc->name, device)) + for (vc = vlan->first_client; vc != NULL; vc = vc->next) { + if (!strcmp(vc->name, device)) { break; + } + } if (!vc) { term_printf("can't find device %s\n", device); return; } + if (!net_host_check_device(vc->model)) { + term_printf("invalid host network device %s\n", device); + return; + } qemu_del_vlan_client(vc); }