qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/2] Net patches
@ 2013-06-07 13:54 Stefan Hajnoczi
  2013-06-07 13:54 ` [Qemu-devel] [PULL 1/2] vmxnet3: fix NICState cleanup Stefan Hajnoczi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2013-06-07 13:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori, Stefan Hajnoczi

The following changes since commit 8819c10b5d55d537d59a0ffd5d623f348fc36c47:

  Merge remote-tracking branch 'sstabellini/xen_fixes_20130603' into staging (2013-06-04 14:58:58 -0500)

are available in the git repository at:


  git://github.com/stefanha/qemu.git net

for you to fetch changes up to c87826a878be05208c3906eb9d5e1f37cff5e98e:

  tap: fix NULL dereference when passing invalid parameters to tap (2013-06-07 15:48:11 +0200)

----------------------------------------------------------------
Jason Wang (1):
      tap: fix NULL dereference when passing invalid parameters to tap

Stefan Hajnoczi (1):
      vmxnet3: fix NICState cleanup

 hw/net/vmxnet3.c |  2 +-
 net/tap.c        | 18 ++++++++++++------
 2 files changed, 13 insertions(+), 7 deletions(-)

-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 1/2] vmxnet3: fix NICState cleanup
  2013-06-07 13:54 [Qemu-devel] [PULL 0/2] Net patches Stefan Hajnoczi
@ 2013-06-07 13:54 ` Stefan Hajnoczi
  2013-06-07 13:54 ` [Qemu-devel] [PULL 2/2] tap: fix NULL dereference when passing invalid parameters to tap Stefan Hajnoczi
  2013-06-17 21:17 ` [Qemu-devel] [PULL 0/2] Net patches Anthony Liguori
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2013-06-07 13:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori, qemu-stable, Stefan Hajnoczi

Use qemu_del_nic() instead of qemu_del_net_client() to correctly free
the entire NICState.

Cc: qemu-stable@nongnu.org
Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 hw/net/vmxnet3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 5f483e7..4c575e5 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -1892,7 +1892,7 @@ static void vmxnet3_net_uninit(VMXNET3State *s)
     vmxnet_tx_pkt_reset(s->tx_pkt);
     vmxnet_tx_pkt_uninit(s->tx_pkt);
     vmxnet_rx_pkt_uninit(s->rx_pkt);
-    qemu_del_net_client(qemu_get_queue(s->nic));
+    qemu_del_nic(s->nic);
 }
 
 static void vmxnet3_net_init(VMXNET3State *s)
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 2/2] tap: fix NULL dereference when passing invalid parameters to tap
  2013-06-07 13:54 [Qemu-devel] [PULL 0/2] Net patches Stefan Hajnoczi
  2013-06-07 13:54 ` [Qemu-devel] [PULL 1/2] vmxnet3: fix NICState cleanup Stefan Hajnoczi
@ 2013-06-07 13:54 ` Stefan Hajnoczi
  2013-06-17 21:17 ` [Qemu-devel] [PULL 0/2] Net patches Anthony Liguori
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2013-06-07 13:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: Anthony Liguori, Jason Wang, qemu-stable, Stefan Hajnoczi,
	Stefan Hajnoczi, Paolo Bonzini, Laszlo Ersek

From: Jason Wang <jasowang@redhat.com>

This patch forbid the following invalid parameters to tap:

1) fd and vhostfds were specified but vhostfd were not specified
2) vhostfds were specified but fds were not specified
3) fds and vhostfd were specified

For 1 and 2, net_init_tap_one() will still pass NULL as vhostfdname to
monitor_handle_fd_param(), which may crash the qemu.

Also remove the unnecessary has_fd check.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <shajnocz@redhat.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 net/tap.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/net/tap.c b/net/tap.c
index e0b7a2a..39c1cda 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -698,9 +698,10 @@ int net_init_tap(const NetClientOptions *opts, const char *name,
     if (tap->has_fd) {
         if (tap->has_ifname || tap->has_script || tap->has_downscript ||
             tap->has_vnet_hdr || tap->has_helper || tap->has_queues ||
-            tap->has_fds) {
+            tap->has_fds || tap->has_vhostfds) {
             error_report("ifname=, script=, downscript=, vnet_hdr=, "
-                         "helper=, queues=, and fds= are invalid with fd=");
+                         "helper=, queues=, fds=, and vhostfds= "
+                         "are invalid with fd=");
             return -1;
         }
 
@@ -725,9 +726,10 @@ int net_init_tap(const NetClientOptions *opts, const char *name,
 
         if (tap->has_ifname || tap->has_script || tap->has_downscript ||
             tap->has_vnet_hdr || tap->has_helper || tap->has_queues ||
-            tap->has_fd) {
+            tap->has_vhostfd) {
             error_report("ifname=, script=, downscript=, vnet_hdr=, "
-                         "helper=, queues=, and fd= are invalid with fds=");
+                         "helper=, queues=, and vhostfd= "
+                         "are invalid with fds=");
             return -1;
         }
 
@@ -765,9 +767,9 @@ int net_init_tap(const NetClientOptions *opts, const char *name,
         }
     } else if (tap->has_helper) {
         if (tap->has_ifname || tap->has_script || tap->has_downscript ||
-            tap->has_vnet_hdr || tap->has_queues || tap->has_fds) {
+            tap->has_vnet_hdr || tap->has_queues || tap->has_vhostfds) {
             error_report("ifname=, script=, downscript=, and vnet_hdr= "
-                         "queues=, and fds= are invalid with helper=");
+                         "queues=, and vhostfds= are invalid with helper=");
             return -1;
         }
 
@@ -785,6 +787,10 @@ int net_init_tap(const NetClientOptions *opts, const char *name,
             return -1;
         }
     } else {
+        if (tap->has_vhostfds) {
+            error_report("vhostfds= is invalid if fds= wasn't specified");
+            return -1;
+        }
         script = tap->has_script ? tap->script : DEFAULT_NETWORK_SCRIPT;
         downscript = tap->has_downscript ? tap->downscript :
             DEFAULT_NETWORK_DOWN_SCRIPT;
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PULL 0/2] Net patches
  2013-06-07 13:54 [Qemu-devel] [PULL 0/2] Net patches Stefan Hajnoczi
  2013-06-07 13:54 ` [Qemu-devel] [PULL 1/2] vmxnet3: fix NICState cleanup Stefan Hajnoczi
  2013-06-07 13:54 ` [Qemu-devel] [PULL 2/2] tap: fix NULL dereference when passing invalid parameters to tap Stefan Hajnoczi
@ 2013-06-17 21:17 ` Anthony Liguori
  2 siblings, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2013-06-17 21:17 UTC (permalink / raw)
  To: Stefan Hajnoczi, qemu-devel; +Cc: Anthony Liguori

Pulled.  Thanks.

Regards,

Anthony Liguori

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-17 21:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-07 13:54 [Qemu-devel] [PULL 0/2] Net patches Stefan Hajnoczi
2013-06-07 13:54 ` [Qemu-devel] [PULL 1/2] vmxnet3: fix NICState cleanup Stefan Hajnoczi
2013-06-07 13:54 ` [Qemu-devel] [PULL 2/2] tap: fix NULL dereference when passing invalid parameters to tap Stefan Hajnoczi
2013-06-17 21:17 ` [Qemu-devel] [PULL 0/2] Net patches 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).