Re: usb-serial.c question - potential Memory fault

Greg KH <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Mon, Jul 30, 2007 at 06:04:06PM +0200, [email protected] wrote:
> Greg,
> 
> It is a problem because I use the pre-allocated buffer given by the layer
> usb-serial.  Of course, I can create a new urb structure with a bigger
> buffer but I just suggest that using the buffer stored in the
> usb_serial_device seems to be logic and like a said, other driver use
> it without checking the buffer_size. Are you sure that the pl2303 is
> well protected against a buffer overflow ?

I do not see any paths within the pl2303 driver that would cause such a
buffer overflow at all.

> What happens if a pl2303 device give a maxsize of 64 bytes like my device ?

It should "just work", as it looks at the size of the buffer it is
filling up when it does it (look at the logic in pl2303_send() for
confirmation of this.)

The 2.4 version of the pl2303 driver is much different, I don't remember
which one you copied your driver from, but I think that one also should
be just fine.

> The driver will then make a buffer overflow and a kernel panic may
> occur. This was the module I used to study and write my own driver.

If you see the same error for the pl2303 driver, please let me know.

> So I agree with the proposition of Oliver to add a buffer_size in the
> usb_serial_driver structure.
> This is very useful to prepare a buffer able to make bulk transfer.

I don't think it is necessary to add as it has not been a problem yet
for any driver that I know of.

I think you are just doing something wrong in your driver :)

thanks,

greg k-h

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.