Re: [linux-usb-devel] can usb_disconnect pre-empt?

2003-06-25 Thread Tuukka Toivonen
On Mon, 23 Jun 2003, Oliver Neukum wrote: If usb_disconnect() can happen while already executing in open(), and if the former frees the data structures used by the driver, then the latter call might continue working with already freed memory region which could lead to catastrophe.

Re: [linux-usb-devel] can usb_disconnect pre-empt?

2003-06-25 Thread Oliver Neukum
Am Mittwoch, 25. Juni 2003 14:33 schrieb Tuukka Toivonen: On Mon, 23 Jun 2003, Oliver Neukum wrote: If usb_disconnect() can happen while already executing in open(), and if the former frees the data structures used by the driver, then the latter call might continue working with already

Re: [linux-usb-devel] can usb_disconnect pre-empt?

2003-06-25 Thread Tuukka Toivonen
Alan Stern wrote: Look at usb-skeleton.c. Exactly this problem was corrected there by adding a static lock a couple of months ago. Thanks for the tip. Although my intention was not to ask how to fix the bug, but point out that ov511.c appears to be buggy. If people agree, I can try fixing it. A

Re: [linux-usb-devel] can usb_disconnect pre-empt?

2003-06-25 Thread Alan Stern
On Wed, 25 Jun 2003, Tuukka Toivonen wrote: Alan Stern wrote: Look at usb-skeleton.c. Exactly this problem was corrected there by adding a static lock a couple of months ago. Thanks for the tip. Although my intention was not to ask how to fix the bug, but point out that ov511.c appears to

Re: [linux-usb-devel] can usb_disconnect pre-empt?

2003-06-25 Thread Alan Stern
On Wed, 25 Jun 2003, Tuukka Toivonen wrote: On Mon, 23 Jun 2003, Oliver Neukum wrote: If usb_disconnect() can happen while already executing in open(), and if the former frees the data structures used by the driver, then the latter call might continue working with already freed memory

[linux-usb-devel] can usb_disconnect pre-empt?

2003-06-23 Thread Tuukka Toivonen
Can usb_disconnect() and usb_probe() functions of a driver pre-empt the driver in other parts? I mean, that if user has just called my open() function in the driver, could usb_disconnect() happen before the system call returns? If usb_disconnect() can happen while already executing in open(), and

Re: [linux-usb-devel] can usb_disconnect pre-empt?

2003-06-23 Thread Greg KH
On Mon, Jun 23, 2003 at 08:39:33PM +0300, Tuukka Toivonen wrote: Can usb_disconnect() and usb_probe() functions of a driver pre-empt the driver in other parts? I mean, that if user has just called my open() function in the driver, could usb_disconnect() happen before the system call returns?

Re: [linux-usb-devel] can usb_disconnect pre-empt?

2003-06-23 Thread Pete Zaitcev
From: Tuukka Toivonen [EMAIL PROTECTED] Date: Mon, 23 Jun 2003 20:39:33 +0300 (EEST) If usb_disconnect() can happen while already executing in open(), and if the former frees the data structures used by the driver, then the latter call might continue working with already freed memory region

Re: [linux-usb-devel] can usb_disconnect pre-empt?

2003-06-23 Thread Duncan Sands
On Monday 23 June 2003 19:53, Greg KH wrote: On Mon, Jun 23, 2003 at 08:39:33PM +0300, Tuukka Toivonen wrote: Can usb_disconnect() and usb_probe() functions of a driver pre-empt the driver in other parts? I mean, that if user has just called my open() function in the driver, could

Re: [linux-usb-devel] can usb_disconnect pre-empt?

2003-06-23 Thread Tuukka Toivonen
On Mon, 23 Jun 2003, Pete Zaitcev wrote: If usb_disconnect() can happen while already executing in open(), and if the former frees the data structures used by the driver, then the latter call might continue working with already freed memory region which could lead to catastrophe. This is why

Re: [linux-usb-devel] can usb_disconnect pre-empt?

2003-06-23 Thread Matthew Dharm
On Mon, Jun 23, 2003 at 08:39:33PM +0300, Tuukka Toivonen wrote: Can usb_disconnect() and usb_probe() functions of a driver pre-empt the driver in other parts? I mean, that if user has just called my open() function in the driver, could usb_disconnect() happen before the system call returns?

Re: [linux-usb-devel] can usb_disconnect pre-empt?

2003-06-23 Thread Alan Cox
On Llu, 2003-06-23 at 19:11, Tuukka Toivonen wrote: Let's suppose user calls open() on my device. The first line of open() call could lock semaphores, increase reference counts, whatever, but all is useless if usb_disconnect() happens _after_ open() system call but _before_ the first line of

Re: [linux-usb-devel] can usb_disconnect pre-empt?

2003-06-23 Thread Pete Zaitcev
Date: Mon, 23 Jun 2003 21:11:35 +0300 (EEST) From: Tuukka Toivonen [EMAIL PROTECTED] If usb_disconnect() can happen while already executing in open(), and if the former frees the data structures used by the driver, then the latter call might continue working with already freed memory

Re: [linux-usb-devel] can usb_disconnect pre-empt?

2003-06-23 Thread Oliver Neukum
Am Montag, 23. Juni 2003 19:39 schrieb Tuukka Toivonen: Can usb_disconnect() and usb_probe() functions of a driver pre-empt the driver in other parts? I mean, that if user has just called my open() function in the driver, could usb_disconnect() happen before the system call returns? Yes.

Re: [linux-usb-devel] can usb_disconnect pre-empt?

2003-06-23 Thread Oliver Neukum
Am Montag, 23. Juni 2003 20:11 schrieb Tuukka Toivonen: On Mon, 23 Jun 2003, Pete Zaitcev wrote: If usb_disconnect() can happen while already executing in open(), and if the former frees the data structures used by the driver, then the latter call might continue working with already freed