lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 15 Dec 2010 19:13:39 +0300
From:	Alexander Gordeev <lasaine@....cs.msu.su>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	Alan Cox <alan@...ux.intel.com>, linux-kernel@...r.kernel.org,
	"Nikita V\. Youshchenko" <yoush@...msu.su>,
	linuxpps@...enneenne.com, Rodolfo Giometti <giometti@...eenne.com>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Arnd Bergmann <arnd@...db.de>,
	Al Viro <viro@...iv.linux.org.uk>,
	Nick Piggin <npiggin@...nel.dk>,
	Jason Wessel <jason.wessel@...driver.com>,
	Philippe Langlais <philippe.langlais@...ricsson.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCHv5 05/17] tty: don't allow ldisc dcd_change() after ldisc
 halt

Hi,

Very sorry for the long delay.

В Thu, 25 Nov 2010 14:03:54 +0000
Alan Cox <alan@...rguk.ukuu.org.uk> пишет:

> > Didn't know that current design is crap. :)
> 
> It's based on the old big kernel lock and it has lots of horrors when
> used from interrupt paths as a result. A big chunk of it can in time I
> think move to just having a per tty ldisc lock that covers all changes
> etc, but we aren't there yet.
> 
> > Ok, I think I'll add a new waitqueue and a new bit (TTY_LDISC_NOREF)
> 
> We've got the wait queue already
> 
> My first guess would be something like
> 
> static struct tty_ldisc *tty_ldisc_irqget(struct tty_struct *tty)
> {
>         unsigned long flags;
>         struct tty_ldisc *ld;
>    
>         spin_lock_irqsave(&tty_ldisc_lock, flags);
>         ld = NULL;
>         if (test_bit(TTY_LDISC, &tty->flags)) {
>                 ld = get_ldisc(tty->ldisc);
> 		WARN_ON(test_and_set_bit(TTY_LDISC_IRQ, &tty->flags));
> 	}
>         spin_unlock_irqrestore(&tty_ldisc_lock, flags);
>         return ld;
> }
> 
> static struct tty_ldisc *tty_ldisc_irqput(struct tty_ldisc *ld)
> {
> 	clear_bit(TTY_LDISC_IRQ, &tty->flags);
> 	tty_ldisc_put(ld);
> }
> 
> (and I think you can then wait on tty_ldisc_idle for the flag to go clear
> after clearing TTY_LDISC)
> 
> It might be better to make it a count of course in case there are later
> multiple users of this ?

I've just checked the code from v2.6.37 release candidates and found
that the problem is already completely fixed there with the revoking of
tty_ldisc_idle and tty_ldisc_wait_idle() in 100eeae2. :)

Sorry for the fuzz. The discussed patched is not needed any more and
will be dropped.

-- 
  Alexander

Download attachment "signature.asc" of type "application/pgp-signature" (491 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ