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-devel

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

To: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xenconsole fix
From: Pete Zaitcev <zaitcev@xxxxxxxxxx>
Date: Fri, 7 Jul 2006 12:24:50 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 07 Jul 2006 12:25:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060707083556.GK4417%yamahata@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Red Hat, Inc.
References: <20060707083556.GK4417%yamahata@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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