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: <20080905140919.05f9edd8@lxorguk.ukuu.org.uk>
Date:	Fri, 5 Sep 2008 14:09:19 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Denis Joseph Barrow <D.Barow@...ion.com>
Cc:	Linux USB kernel mailing list <linux-usb@...r.kernel.org>,
	Linux netdev Mailing list <netdev@...r.kernel.org>,
	Németh Tamás <nice@...anic.nyme.hu>
Subject: Re: [PATCH]  hso.c against 2.6.27-rc5 throttle/unthrottle to
 prevent loss of serial data

O> Alan you'll notice I'm calling tty_flip_buffer_push(tty)
> i.e. flush_to_ldisc every 32 bytes as
> TTY_THRESHOLD_THROTTLE in /drivers/char/n_tty.c is
> only 128 bytes & I need to get unthrottled before
> I lose characters it would be nice if the tty layer
> could set the size of the throttle/unthrottle parameters
> & the size of the n_tty ring buffer.

I don't really follow what you are trying to do here. You have two layers
of buffering to consider

   Driver -> | tty buffer queue (64k) | n_tty - internal queue | user


And it is when the internal queue gets full that we call throttle not
when the 64K of tty buffering is full.

So you really shouldn't see a problem unless you have many Kbytes of USB
requests floating around to consume all the buffering even after the tty
is throttled.

As to the robustness - the USB tty code is generally pretty bad in this
area so hso won't be any worse. Probably it is sufficient to keep an eye
on what is in flight and when an URB completes don't just reissue it but
reissue any others that didn't get posted due to errors.

The only other case you then have to trap is the nothing could be queued
case which should never happen and I guess if you are passionate about
robustness would need a timer.

Alan
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ