[PATCH] USB serial ftdi_sio: Prevent userspace DoS
authorIan Abbott <abbotti@mev.co.uk>
Mon, 26 Jun 2006 11:59:17 +0000 (12:59 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 12 Jul 2006 23:03:22 +0000 (16:03 -0700)
commit224654004ca688af67cec44d9300e8c3f647577c
tree79c9f18053299dd1ab09fbab71abcb653e8c99e9
parent00d6058ac93048b525b86fa48b413dcb87ac2728
[PATCH] USB serial ftdi_sio: Prevent userspace DoS

This patch limits the amount of outstanding 'write' data that can be
queued up for the ftdi_sio driver, to prevent userspace DoS attacks (or
simple accidents) that use up all the system memory by writing lots of
data to the serial port.

The original patch was by Guillaume Autran, who in turn based it on the
same mechanism implemented in the 'visor' driver.  I (Ian Abbott)
re-targeted the patch to the latest sources, fixed a couple of errors,
renamed his new structure members, and updated the implementations of
the 'write_room' and 'chars_in_buffer' methods to take account of the
number of outstanding 'write' bytes.  It seems to work fine, though at
low baud rates it is still possible to queue up an amount of data that
takes an age to shift (a job for another day!).

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/ftdi_sio.c