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:	Mon, 12 Mar 2007 18:20:12 -0400
From:	Mark Lord <lkml@....ca>
To:	Greg KH <greg@...ah.com>
Cc:	Jim Radford <radford@...ckbean.org>,
	linux-usb-devel@...ts.sourceforge.net,
	Oliver Neukum <oneukum@...e.de>, Adrian Bunk <bunk@...sta.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] usb-serial regression (Oops)  in 2.6.21-rc*

Greg KH wrote:
>>>> Mark Lord wrote:
>> This patch fixes the Oops that otherwise occurs whenever
>> a USB serial adapter is unplugged from a system, as well
>> the Oops seen when one is in use before resume (to RAM).
>>
>> GregKH:  This needs to go into 2.6.21-rc*.
>>
>> Signed-off-by:  Mark Lord <mlord@...ox.com>
>> ---
>> --- 2.6.21-rc3/drivers/usb/serial/usb-serial.c	2007-03-12 
>> 11:22:43.000000000 -0400
>> +++ linux/drivers/usb/serial/usb-serial.c	2007-03-12 
>> 16:12:53.000000000 -0400
>> @@ -141,6 +141,9 @@
>> 	for (i = 0; i < serial->num_ports; ++i)
>> 		serial->port[i]->open_count = 0;
>>
>> +	if (serial->type->shutdown)
>> +		serial->type->shutdown(serial);
>> +
>> 	/* the ports are cleaned up and released in port_release() */
>> 	for (i = 0; i < serial->num_ports; ++i)
>> 		if (serial->port[i]->dev.parent != NULL) {
>> @@ -148,9 +151,6 @@
>> 			serial->port[i] = NULL;
>> 		}
>>
>> -	if (serial->type->shutdown)
>> -		serial->type->shutdown(serial);
>> -
>
> Argh, no, this change was done to help the ftdi drivers out.
> 
> Look at changeset d9a7ecacac5f8274d2afce09aadcf37bdb42b93a in Linus's
> tree from Jim Radford:
> 	http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d9a7ecacac5f8274d2afce09aadcf37bdb42b93a
> 
> It makes this change because the usb-serial drivers need the port
> devices when the port_remove() callbacks happen.  Otherwise you get an
> oops that way.

Oh, good. Now we know the exact changeset that caused the regression, thanks.
That patch should either get reverted, or an alternative fix be posted.

Such as.. this one, from earlier, except perhaps minus the WARN_ON()s:

Signed-off-by:  Mark Lord <mlord@...ox.com>
---
--- linux/include/linux/usb/serial.h.orig	2007-03-12 12:18:48.000000000 -0400
+++ linux/include/linux/usb/serial.h	2007-03-12 12:18:23.000000000 -0400
@@ -99,11 +99,19 @@
 /* get and set the port private data pointer helper functions */
 static inline void *usb_get_serial_port_data (struct usb_serial_port *port)
 {
+	if (!port) {
+		/* WARN_ON(1);*/
+		return NULL;
+	}
 	return dev_get_drvdata(&port->dev);
 }
 
 static inline void usb_set_serial_port_data (struct usb_serial_port *port, void *data)
 {
+	if (!port) {
+		/* WARN_ON(1); */
+		return;
+	}
 	dev_set_drvdata(&port->dev, data);
 }
 

-
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