* [Qemu-devel] [7195] net: Check device passed to host_net_remove (Jan Kiszka)
@ 2009-04-21 19:56 Anthony Liguori
0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2009-04-21 19:56 UTC (permalink / raw)
To: qemu-devel
Revision: 7195
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7195
Author: aliguori
Date: 2009-04-21 19:56:08 +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 <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Modified Paths:
--------------
trunk/net.c
Modified: trunk/net.c
===================================================================
--- trunk/net.c 2009-04-21 01:41:10 UTC (rev 7194)
+++ trunk/net.c 2009-04-21 19:56:08 UTC (rev 7195)
@@ -1858,14 +1858,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) {
monitor_printf(mon, "can't find device %s\n", device);
return;
}
+ if (!net_host_check_device(vc->model)) {
+ monitor_printf(mon, "invalid host network device %s\n", device);
+ return;
+ }
qemu_del_vlan_client(vc);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-04-21 19:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-21 19:56 [Qemu-devel] [7195] net: Check device passed to host_net_remove (Jan Kiszka) Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).