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

Re: [Xen-devel] [PATCH] xenconsole fix



On Fri, 7 Jul 2006 17:35:56 +0900, Isaku Yamahata <yamahata@xxxxxxxxxxxxx> 
wrote:

> xenconsole fix. reference of tty->count in xencons_close() is racy.
> It must be protected by tty_sem semaphore like con_close() in
> drivers/char/vt.c

> +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c      Fri Jul 07 
> 17:34:08 2006 +0900
> @@ -536,6 +536,7 @@ static void xencons_close(struct tty_str
>       if (DUMMY_TTY(tty))
>               return;
>  
> +     down(&tty_sem);
>       if (tty->count == 1) {
>               tty->closing = 1;
>               tty_wait_until_sent(tty, 0);
......
>       }
> +     up(&tty_sem);
>  }

This is clearly not a safe idea. You do not know what the line
discipline is going to do. If you are concerned about tty->count,
then why don't you drop the mutex before all those convoluted
functions get called?

-- Pete

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


 


Rackspace

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