Fix xenconsoled SEGV if domain is destroyed while connected.
PATCH 1/1 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_.
tools/console/daemon/io.c +8 -10
@@ -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 ); }
Resend: [PATCH][TOOLS] Fix xenconsoled SEGV if domain is destroyed while connected.
Any response to this?
http://lists.xensource.com/archives/html/xen-devel/2006-08/
msg01315.html
Quoted 43 lines · Jimi Xenidis
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 setd->tty_fdto -1 it has to be checked _every_time_.Signed-off-by Jimi Xenidis <[email protected]>diff -r
00c47d5766100994d1b936873629256874a8d5ba-rd2087a16bc5153d6abc4d28b3bcc39904a6c65b6tools/console/daemon/io.ctools/console/daemon/io.c +8
-10@@ -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-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: Resend: [PATCH][TOOLS] Fix xenconsoled SEGV if domain is destroyed while connected.
Quoted 3 lines · Jimi Xenidis
Any response to this?
http://lists.xensource.com/archives/html/xen-devel/2006-08/
msg01315.html
It's fine. I'm just behind on applying patches.
-- Keir