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]
Message-ID: <Pine.LNX.4.64.0811201536150.23073@lxtpfaff.pcs.ditec.de>
Date:	Thu, 20 Nov 2008 16:12:45 +0100 (CET)
From:	Thomas Pfaff <tpfaff@....com>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
cc:	linux-kernel@...r.kernel.org
Subject: Re: Question about TTY_DO_WRITE_WAKEUP


On Thu, 20 Nov 2008, Alan Cox wrote:

> > Is the TTY_DO_WRITE_WAKEUP bit some kind of cruft that can be removed entirely 
> > or should i generate a patch for serial devices only ?
> 
> It shouldn't happen at the serial level. The line discipline sets the
> flag as and when it has data for the process above.
> 
> The expected flow in normal use is
> 
> 	app writes to tty
> 		data goes to n_tty ldisc
> 			goes to tty
> 		n_tty ldisc seems tty blocked
> 		n_tty ldisc sets DO_WRITE_WAKEUP
> 
> 	tty gets ucongested
> 		calls n_tty write_wakeup
> 			SIGIO sent
> 			Flag set again
> 
> The important part of the logic is in n_tty.c and tty_io.c

Following the source the TTY_DO_WRITE_WAKEUP flag is set in n_tty_write_wakeup. 

But n_tty_write_wakeup is only called from tty_wakeup when this bit is already 
set, therefore it makes no sense to set this bit in n_tty_write_wakeup again.

The flow looks to me as

If the tty driver sets TTY_DO_WRITE_WAKEUP a SIGIO is generated on every 
tty_wakeup.

If it is not set then n_tty_write_wakeup is never called and a SIGIO is not 
generated.

Thomas

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