[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.01.0907291147570.3161@localhost.localdomain>
Date:	Wed, 29 Jul 2009 12:07:20 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
cc:	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>,
	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
	"Rafael J. Wysocki" <rjw@...k.pl>, Ray Lee <ray-lk@...rabbit.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] kdesu broken
On Wed, 29 Jul 2009, Alan Cox wrote:
> 
> Odds of hitting it minimal however. Or maybe we need a smarter
> tty_ldisc_wait_idle(ld) ?
Just adding the ldisc_mutex around the call sounds like the simplest 
solution. 
That said, looking at the callers of tty_ldisc_wait_idle(), it looks like 
we have other similar problems already in tty_ldisc_release(), which also 
calls it without holding the lock, both for the "self" case and then 
recursively for o_tty.
Moving the mutex_lock() up a bit in tty_ldisc_release() looks like the 
trivial solution, although I suspect there are any deadlock issues there 
(ie refs that won't go away because we hold the lock and the thing we are 
waiting for needs the lock to release the ldisc!).
So making tty_ldisc_wait_idle() more careful adn work without the lock 
would definitely be the safer thing to do. Requiring the lock looks 
potentially pretty dangerous.
		Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Powered by blists - more mailing lists
 
