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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.01.0910151447440.6146@localhost.localdomain>
Date:	Thu, 15 Oct 2009 14:49:56 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
cc:	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Oleg Nesterov <oleg@...hat.com>,
	Paul Fulghum <paulkf@...rogate.com>,
	Boyan <btanastasov@...oo.co.uk>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Kernel Testers List <kernel-testers@...r.kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Ed Tomlinson <edt@....ca>
Subject: Re: [Bug #14388] keyboard under X with 2.6.31



On Fri, 16 Oct 2009, OGAWA Hirofumi wrote:
> 
> I.e. the following or something,
> 
> static inline int input_available_p(struct tty_struct *tty, int amt)
> {
> 	int try = 0;
> 
> retry:
> 	if (tty->icanon) {
> 		if (tty->canon_data)
> 			return 1;
> 	} else if (tty->read_cnt >= (amt ? amt : 1))
> 		return 1;
> 
> 	if (!checked) {
> 		tty_flush_to_ldisc(tty);
> 		try = 1;
> 		goto retry;
> 	}
> 
> 	return 0;
> }

Yeah, we could do that. Especially if we ever see this in any profiles. I 
doubt we do, but..

> Sorry if I'm missing the point. Doesn't this have (possible) race with
> schedule_delayed_work() (i.e. by tty writer)?
> 
>              cpu0                                      cpu1
> 
>     if (del_timer(&dwork->timer)) {
>                                             // cpu0 doesn't set _PENDING
>                                             schedule_delayed_work()

We don't care.

We want to make sure that a writer that wrote the data strictly _before_ 
the reader is reading will always have the data show up.

But if the writer is exactly concurrent with the reader, it's fine to not 
see the data. Because at that point, we will rely not on the tty buffers, 
but on the writer doing a tty_wakeup() to notify us that there is new 
data.

			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

Powered by Openwall GNU/*/Linux Powered by OpenVZ