[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] The following patch fixes a bug where xenconsoled will can SEGV



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxxx
# Node ID c61b8296b39a261dc407e9585f666cffd4064198
# Parent  439fa5d6c5ce5d64921cd1923eecdae40967d6e9
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 439fa5d6c5ce -r c61b8296b39a tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Mon Aug 28 12:49:14 2006 +0100
+++ b/tools/console/daemon/io.c Mon Aug 28 12:50:55 2006 +0100
@@ -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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.