WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [xenppc-unstable] [TOOLS] Fix xenconsoled SEGV if domain is des

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [xenppc-unstable] [TOOLS] Fix xenconsoled SEGV if domain is destroyed while connected.
From: Xen patchbot-xenppc-unstable <patchbot-xenppc-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 24 Aug 2006 18:10:31 +0000
Delivery-date: Thu, 24 Aug 2006 11:20:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID d2087a16bc5153d6abc4d28b3bcc39904a6c65b6
# Parent  00c47d5766100994d1b936873629256874a8d5ba
[TOOLS] Fix xenconsoled SEGV if domain is destroyed while connected.

The following patch fixes a bug where xenconsoled will can SEGV
because it uses FD_ISSET(-1,xxx).  Since the code is written that any
ring/tty handler can set d->tty_fd to -1 it has to be checked
_every_time_.

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---
 tools/console/daemon/io.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff -r 00c47d576610 -r d2087a16bc51 tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Wed Aug 23 05:49:29 2006 -0400
+++ b/tools/console/daemon/io.c Thu Aug 24 13:42:05 2006 -0400
@@ -584,16 +584,14 @@ void handle_io(void)
                            FD_ISSET(xc_evtchn_fd(d->xce_handle), &readfds))
                                handle_ring_read(d);
 
-                       if (d->tty_fd != -1) {
-                               if (FD_ISSET(d->tty_fd, &readfds))
-                                       handle_tty_read(d);
-
-                               if (FD_ISSET(d->tty_fd, &writefds))
-                                       handle_tty_write(d);
-
-                               if (d->is_dead)
-                                       cleanup_domain(d);
-                       }
+                       if (d->tty_fd != -1 && FD_ISSET(d->tty_fd, &readfds))
+                               handle_tty_read(d);
+
+                       if (d->tty_fd != -1 && FD_ISSET(d->tty_fd, &writefds))
+                               handle_tty_write(d);
+
+                       if (d->is_dead)
+                               cleanup_domain(d);
                }
        } while (ret > -1);
 }

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [xenppc-unstable] [TOOLS] Fix xenconsoled SEGV if domain is destroyed while connected., Xen patchbot-xenppc-unstable <=