Re: [PATCH] Input: aiptek: fix crash on detecting device without endpoints

2015-12-02 Thread Vladis Dronov
Hello, Dmitry, > > + if (intf->altsetting[0].desc.bNumEndpoints < 1) { > > + dev_warn(&intf->dev, > > This should be dev_err as we are aborting device initialization. I know > the driver user warn/info in similar places, but it is not right, we > might want to adjust it at some point.

Re: [PATCH] Input: aiptek: fix crash on detecting device without endpoints

2015-12-01 Thread Dmitry Torokhov
Hi Vladis, On Wed, Nov 25, 2015 at 04:58:08PM +0100, Vladis Dronov wrote: > The aiptek driver crashes in aiptek_probe() when a specially crafted usb > device > without endpoints is detected. This fix adds a check that the device has > proper > configuration expected by the driver. Also an error

Re: [PATCH] Input: aiptek: fix crash on detecting device without endpoints

2015-12-01 Thread Alan Stern
On Tue, 1 Dec 2015, Vladis Dronov wrote: > Hello, Alan, > > Thank you for the explanations and I'm sorry for my terminology > misunderstanding, I got the point now, endpoint 0 != endpoint[0]. That's okay; it's an understandable mistake. > > My advice is to fix aiptek's probe routine. It should

Re: [PATCH] Input: aiptek: fix crash on detecting device without endpoints

2015-12-01 Thread Vladis Dronov
Hello, Alan, Thank you for the explanations and I'm sorry for my terminology misunderstanding, I got the point now, endpoint 0 != endpoint[0]. > My advice is to fix aiptek's probe routine. It should check that > intf->altsetting[0].desc.bNumEndpoints > 0 before trying to accessing > the endpoin

Re: [PATCH] Input: aiptek: fix crash on detecting device without endpoints

2015-11-30 Thread Dmitry Torokhov
On Mon, Nov 30, 2015 at 03:38:20PM -0500, Alan Stern wrote: > On Mon, 30 Nov 2015, Dmitry Torokhov wrote: > > > How about we do something like below? > > It looks okay to me. If you want to propose it on the linux-usb > mailing list, you can add: > > Acked-by: Alan Stern I will, thank you Al

Re: [PATCH] Input: aiptek: fix crash on detecting device without endpoints

2015-11-30 Thread Alan Stern
On Mon, 30 Nov 2015, Dmitry Torokhov wrote: > How about we do something like below? It looks okay to me. If you want to propose it on the linux-usb mailing list, you can add: Acked-by: Alan Stern Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the bod

Re: [PATCH] Input: aiptek: fix crash on detecting device without endpoints

2015-11-30 Thread Dmitry Torokhov
On Mon, Nov 30, 2015 at 11:06:30AM -0500, Alan Stern wrote: > On Mon, 30 Nov 2015, Vladis Dronov wrote: > > > Hello, Alan, all. > > Hello. > > > > > Yes for the normal USB device. This case is a weird USB device (with no > > > > endpoints) specially designed to be weird. My point here is that ev

Re: [PATCH] Input: aiptek: fix crash on detecting device without endpoints

2015-11-30 Thread Alan Stern
On Mon, 30 Nov 2015, Vladis Dronov wrote: > Hello, Alan, all. Hello. > > > Yes for the normal USB device. This case is a weird USB device (with no > > > endpoints) specially designed to be weird. My point here is that even a > > > weird device probing should not crash a kernel by a NULL-deref. >

Re: [PATCH] Input: aiptek: fix crash on detecting device without endpoints

2015-11-30 Thread Vladis Dronov
Hello, Alan, all. > > > > Hmm, I see quite a few drivers assuming that endpoint 0 will be present. > > > > I wonder if that should not be solved at USB level. > > > > > > Every USB device always has endpoint 0. If one didn't, the kernel > > > wouldn't be able to initialize and enumerate it. > >

Re: [PATCH] Input: aiptek: fix crash on detecting device without endpoints

2015-11-27 Thread Alan Stern
On Fri, 27 Nov 2015, Vladis Dronov wrote: > Hello, > > > > Hmm, I see quite a few drivers assuming that endpoint 0 will be present. > > > I wonder if that should not be solved at USB level. > > > > Every USB device always has endpoint 0. If one didn't, the kernel > > wouldn't be able to initial

Re: [PATCH] Input: aiptek: fix crash on detecting device without endpoints

2015-11-27 Thread Vladis Dronov
Hello, > > Hmm, I see quite a few drivers assuming that endpoint 0 will be present. > > I wonder if that should not be solved at USB level. > > Every USB device always has endpoint 0. If one didn't, the kernel > wouldn't be able to initialize and enumerate it. Yes for the normal USB device. Thi

Re: [PATCH] Input: aiptek: fix crash on detecting device without endpoints

2015-11-26 Thread Alan Stern
On Thu, 26 Nov 2015, Dmitry Torokhov wrote: > Hi Vladis, > > On Wed, Nov 25, 2015 at 04:58:08PM +0100, Vladis Dronov wrote: > > The aiptek driver crashes in aiptek_probe() when a specially crafted usb > > device > > without endpoints is detected. This fix adds a check that the device has > > pr

Re: [PATCH] Input: aiptek: fix crash on detecting device without endpoints

2015-11-26 Thread Dmitry Torokhov
Hi Vladis, On Wed, Nov 25, 2015 at 04:58:08PM +0100, Vladis Dronov wrote: > The aiptek driver crashes in aiptek_probe() when a specially crafted usb > device > without endpoints is detected. This fix adds a check that the device has > proper > configuration expected by the driver. Also an error

[PATCH] Input: aiptek: fix crash on detecting device without endpoints

2015-11-25 Thread Vladis Dronov
The aiptek driver crashes in aiptek_probe() when a specially crafted usb device without endpoints is detected. This fix adds a check that the device has proper configuration expected by the driver. Also an error return value is changed to more matching one in one of the error paths. Reported-by: R