Commit Graph

18 Commits (704936a25bda9bb12e35bb222d5e3f26186dc279)

Author SHA1 Message Date
Luiz Fernando Capitulino 704936a25b [PATCH] usbserial: Fixes use-after-free in serial_open().
If the device is disconnected while serial_open() is executing and
either try_module_get() or the device specific open function fails, the
kref_put() call in the 'bailout_kref_put' label will free the memory
pointed out by 'port'.

The subsequent dereferences in the 'bailout_kref_put' label will be
invalid.

The fix is just to assure kref_put() is called after any 'port' usage.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-05-12 11:58:09 -07:00
Luiz Fernando Capitulino 1ce7dd26e0 [PATCH] USB serial: Converts port semaphore to mutexes.
The usbserial's port semaphore used to synchronize serial_open()
and serial_close() are strict mutexes, convert them to the mutex
implementation.

Signed-off-by: Luiz Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-14 11:12:20 -07:00
Eric Sesterhenn 80b6ca4832 [PATCH] USB: kzalloc() conversion for rest of drivers/usb
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-20 14:49:59 -08:00
Greg Kroah-Hartman 91c0bce29e [PATCH] USB Serial: fix use-after-free bug in usb-serial core
This fixes a use-after-free bug in the usb-serial core.  It is simple to
trigger this (open a usb-serial port, then yank the device out before
closing the port.)  Thanks to Stefan Seyfried <seife@suse.de> for
reporting this, and to the slab debugging code which enabled it to be
tracked down.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-06 13:29:00 -08:00
Adrian Bunk 93b1fae491 spelling: s/trough/through/
Additionally, one comment was reformulated by Joe Perches <joe@perches.com>.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-01-10 00:13:33 +01:00
Luiz Fernando Capitulino 8a4613f01f [PATCH] USB: usbserial: race-condition fix.
There is a race-condition in usb-serial driver that can be triggered if
a processes does 'port->tty->driver_data = NULL' in serial_close() while
other processes is in kernel-space about to call serial_ioctl() on the
same port.

This happens because a process can open the device while there is
another one closing it.

The patch below fixes that by adding a semaphore to ensure that no
process will open the device while another process is closing it.

Note that we can't use spinlocks here, since serial_open() and
serial_close() can sleep.

Signed-off-by: Luiz Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04 13:48:35 -08:00
Luiz Fernando Capitulino 487f9c6710 [PATCH] USB: usbserial: Adds missing checks and bug fix.
Checks if 'port' is NULL before using it in all tty operations, this
can avoid NULL pointer dereferences.

Signed-off-by: Luiz Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04 13:48:35 -08:00
Greg Kroah-Hartman 75318d2d7c [PATCH] USB: remove .owner field from struct usb_driver
It is no longer needed, so let's remove it, saving a bit of memory.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04 13:48:34 -08:00
Greg Kroah-Hartman ba9dc657af [PATCH] USB: allow usb drivers to disable dynamic ids
This lets drivers, like the usb-serial ones, disable the ability to add
ids from sysfs.

The usb-serial drivers are "odd" in that they are really usb-serial bus
drivers, not usb bus drivers, so the dynamic id logic will have to go
into the usb-serial bus core for those drivers to get that ability.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04 13:48:32 -08:00
Greg Kroah-Hartman 17a882fc0c [PATCH] USB Serial: remove driver version from a few drivers
These numbers are pointless, as they have not been changed in _years_,
so we should just remove them to stop pretending there is an actual
"version number" for these drivers.

This should also help reduce confusion when people try to ask for
support of a specific driver version, as there has been no way to tell
what they are talking about.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28 16:47:48 -07:00
Greg Kroah-Hartman 269bda1c12 [PATCH] USB Serial: move name to driver structure
This fixes up a lot of problems in sysfs with some of the usb serial
drivers, they had incorrect driver names.  Also saves a tiny ammount
of memory.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28 16:47:48 -07:00
Greg Kroah-Hartman 502b95c1cc [PATCH] USB Serial: move old changelog comments out of source code
Create a new file just for these things, as they just get in the
way in the source files.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28 16:47:48 -07:00
Greg Kroah-Hartman 18fcac353f [PATCH] USB Serial: get rid of the .owner field in usb_serial_driver
Don't duplicate something that's already in struct driver.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28 16:47:48 -07:00
Greg Kroah-Hartman ea65370d02 [PATCH] USB Serial: rename usb_serial_device_type to usb_serial_driver
I'm tired of trying to explain why a "device_type" is really a driver.
This better describes exactly what this structure is.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28 16:47:47 -07:00
Tobias Klauser 81671ddb7e [PATCH] USB: drivers/serial/usb-serial: Remove unneeded void * casts
The following patch removes unneeded casts for the following (void *) pointers:
	- tty_struct->driver_data
	- void *private argument of usb_serial_port_softint()

Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-08 16:22:16 -07:00
Greg Kroah-Hartman 507ca9bc04 [PATCH] USB: add ability for usb-serial drivers to determine if their write urb is currently being used.
This removes a lot of racy and buggy code by trying to check the status of the urb.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27 14:43:47 -07:00
Greg Kroah-Hartman 06299db3e7 [PATCH] USB: fix usb-serial generic initialization
At module load time, if a generic device is found, the tty information
for the device is not set up properly (as the tty structures aren't initialized
yet.)  This can cause big problems for things like udev.  This patch fixes this.

Thanks to Kay Sievers for the original patch for this problem.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-05-31 14:13:59 -07:00
Linus Torvalds 1da177e4c3 Linux-2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!
2005-04-16 15:20:36 -07:00