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:	Fri, 17 Jul 2009 12:36:22 -0400
From:	"Harris, Jeff" <Jeff_Harris@...trox.com>
To:	"Alan Cox" <alan@...rguk.ukuu.org.uk>
Cc:	<alan@...ux.intel.com>, <vapier@...too.org>, <adobriyan@...il.com>,
	<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] tty: Fix tcdrain hang due to tty chars_in_buffer errors

That was my other thought, but there are other kernel drivers which do
report errors from chars_in_buffer.  A grep of the code shows
ipw_chars_in_buffer in drivers/char/pcmcia/ipwireless/tty.c,
hvc_chars_in_buffer in hvc_console.c, ntty_chars_in_buffer in nozomi.c,
if_chars_in_buffer in isdn/gigaset/interface.c, etc.  Do they all need
to be updated?  

Should the return type be unsigned int to make the behavior more
explicit?  The signed type may be interpreted along the lines of a read
or write call which returns a count or a negative value to indicate a
failure.

Jeff

-----Original Message-----
From: Alan Cox [mailto:alan@...rguk.ukuu.org.uk] 
Sent: Friday, July 17, 2009 12:01 PM
To: Harris, Jeff
Cc: alan@...ux.intel.com; vapier@...too.org; adobriyan@...il.com;
linux-kernel@...r.kernel.org; Harris, Jeff
Subject: Re: [PATCH] tty: Fix tcdrain hang due to tty chars_in_buffer
errors

On Fri, 17 Jul 2009 11:07:54 -0400
Jeff Harris <jeff_harris@...trox.com> wrote:

> If a tty driver's chars_in_buffer callback reports an error, the wait
loop in

chars_in_buffer cannot report an error. It reports how many characters
are in the buffer.

> A process calling tcdrain will block indefinitely if it calls tcdrain
when the
> device is disconnected.

Fix your chars_in_buffer. On a disconnect its quite reasonable to return
0, as they are not buffered any more.

Alan

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