Re: [PATCH 1/1] usb: cdc-acm: handle unlinked urb in acm read callback

2015-12-29 Thread Oliver Neukum
> to -ENOENT even those urbs might have data not processed yet. > Hence, data loss occurs. > > This patch lets bulk-in callback function handle unlinked urbs > to avoid data loss. > > Signed-off-by: Tang Jian Qiang > Signed-off-by: Lu Baolu > Cc: stable@vger

Re: [PATCH 2/2] drivers/usb: Delete XHCI command timer if necessary

2015-08-12 Thread Oliver Neukum
On Wed, 2015-08-12 at 13:55 +0300, Mathias Nyman wrote: > Fortunately this can only happen in cases where xhci is already hosed > (no command response for 5 seconds), and we are at the same time > anyway about to remove xhci. > > Doesn't this mean that all cases with > if (timer_pending(&timer))

Re: [PATCH 2/2] drivers/usb: Delete XHCI command timer if necessary

2015-08-11 Thread Oliver Neukum
On Mon, 2015-08-03 at 16:07 +0300, Mathias Nyman wrote: > From: Gavin Shan > > When xhci_mem_cleanup() is called, it's possible that the command > timer isn't initialized and scheduled. For those cases, to delete > the command timer causes soft-lockup as below stack dump shows. > > The patch avo

Re: [PATCH] usb-storage: ignore ZTE MF 823 in mode 0x1225

2015-07-06 Thread Oliver Neukum
On Thu, 2015-07-02 at 20:33 +0700, Lars Melin wrote: > Yes but there are other 19d2:1225 devices which don't have dual-mode > (19d2:1403 RNDIS or 19d2:1405 ECM) they do only have one of the modes > and they don't auto-flip so they need usb_modeswitch. > > This is the first 3G dongle I have seen

[PATCH] usb-storage: ignore ZTE MF 823 card reader in mode 0x1225

2015-07-06 Thread Oliver Neukum
an unclean removal become inevitable. This replaces an earlier patch that ignored all LUNs of this device. That patch was overly broad. Signed-off-by: Oliver Neukum CC: stable@vger.kernel.org --- drivers/usb/storage/unusual_devs.h | 12 1 file changed, 12 insertions(+) diff --git a

Re: [PATCH] usb-storage: ignore ZTE MF 823 in mode 0x1225

2015-07-02 Thread Oliver Neukum
On Thu, 2015-07-02 at 20:33 +0700, Lars Melin wrote: > On 2015-07-02 20:01, Oliver Neukum wrote: > > On Thu, 2015-07-02 at 14:43 +0200, Oliver Neukum wrote: > >> On Wed, 2015-07-01 at 22:50 +0700, Lars Melin wrote: > >> > >>> Then I would like to see an lsus

Re: [PATCH] usb-storage: ignore ZTE MF 823 in mode 0x1225

2015-07-02 Thread Oliver Neukum
On Thu, 2015-07-02 at 14:43 +0200, Oliver Neukum wrote: > On Wed, 2015-07-01 at 22:50 +0700, Lars Melin wrote: > > > Then I would like to see an lsusb listing for 19d2:1225 with an SD-card > > interface, I have only seen 19d2:1225 with a single storage interface > >

Re: [PATCH] usb-storage: ignore ZTE MF 823 in mode 0x1225

2015-07-02 Thread Oliver Neukum
On Wed, 2015-07-01 at 22:50 +0700, Lars Melin wrote: > Then I would like to see an lsusb listing for 19d2:1225 with an SD-card > interface, I have only seen 19d2:1225 with a single storage interface > which is for the windows install cd-rom. > There are almost no 3G dongles having the SD-card in

Re: [PATCH] usb-storage: ignore ZTE MF 823 in mode 0x1225

2015-07-02 Thread Oliver Neukum
On Wed, 2015-07-01 at 22:50 +0700, Lars Melin wrote: Hi, > Then I would like to see an lsusb listing for 19d2:1225 with an SD-card > interface, I have only seen 19d2:1225 with a single storage interface > which is for the windows install cd-rom. My dongle indeed has only one interface. But one

[PATCH] usb-storage: ignore ZTE MF 823 in mode 0x1225

2015-07-01 Thread Oliver Neukum
/storage/unusual_devs.h @@ -2065,6 +2065,17 @@ UNUSUAL_DEV( 0x1908, 0x3335, 0x0200, 0x0200, USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_NO_READ_DISC_INFO ), +/* Reported by Oliver Neukum + * This device morphes spontaneously into another device if the access + * pattern

Re: [PATCH] hid-ids.h: fix typo

2015-03-31 Thread Oliver Neukum
On Tue, 2015-03-31 at 22:00 +0200, Jiri Slaby wrote: > On 03/31/2015, 02:36 PM, Oliver Neukum wrote: > > There is a typo in a device ID > > Hi, this should have gone to jikos instead ;). It has. Unless I am very mistaken. I made a version against your tree driven by embarasment.

[PATCH] hid-ids.h: fix typo

2015-03-31 Thread Oliver Neukum
There is a typo in a device ID Signed-off-by: Oliver Neukum CC: stable@vger.kernel.org --- drivers/hid/hid-ids.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 56a4ed6..4ee0fb0 100644 --- a/drivers/hid/hid-ids.h +++ b

[PATCH] usbhid: typo in device ID

2015-03-27 Thread Oliver Neukum
The device ID was wrong. Signed-off-by: Oliver Neukum CC: stable@vger.kernel.org --- drivers/hid/hid-ids.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 9c47867..559d31c 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers

[PATCH] hid: add quirk for PIXART OEM mouse used by HP

2015-03-25 Thread Oliver Neukum
This mouse is also known under other IDs. It needs the quirk or will disconnect in runlevel 1 or 3. Signed-off-by: Oliver Neukum CC: stable@vger.kernel.org --- drivers/hid/hid-ids.h | 1 + drivers/hid/usbhid/hid-quirks.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers

[PATCH] HID: add HP OEM mouse to quirk ALWAYS_POLL

2015-03-25 Thread Oliver Neukum
This mouse needs QUIRK_ALWAYS_POLL Signed-off-by: Oliver Neukum CC: stable@vger.kernel.org --- drivers/hid/hid-ids.h | 3 +++ drivers/hid/usbhid/hid-quirks.c | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 9c47867..7ace715

[PATCH 3/3] cdc-wdm: fix endianness bug in debug statements

2015-03-20 Thread Oliver Neukum
Values directly from descriptors given in debug statements must be converted to native endianness. Signed-off-by: Oliver Neukum CC: stable@vger.kernel.org --- drivers/usb/class/cdc-wdm.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/usb/class/cdc-wdm.c

[PATCH] cdc-acm: add sanity checks

2015-01-28 Thread Oliver Neukum
Check the special CDC headers for a plausible minimum length. Another big operating systems ignores such garbage. Signed-off-by: Oliver Neukum CC: stable@vger.kernel.org Reviewed-by: Adam Lee Tested-by: Adam Lee --- drivers/usb/class/cdc-acm.c | 21 - 1 file changed, 16

[PATCH] cdc-acm: memory leak in error case

2014-11-20 Thread Oliver Neukum
If probe() fails not only the attributes need to be removed but also the memory freed. Reported-by: Ahmed Tamrawi Signed-off-by: Oliver Neukum CC: stable@vger.kernel.org --- drivers/usb/class/cdc-acm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/class/cdc-acm.c b/drivers

Re: after stable is before stable

2014-11-19 Thread Oliver Neukum
On Wed, 2014-11-19 at 13:17 +0100, Jiri Slaby wrote: > Hi, > > all below look good to me. They are for the net subsystem, however. And > since David maintains 3.12 stable net patches, I am not going to take > them directly (or at least not until his prior ACK). So you have no connection with driv

[PATCH] HID: yet another buggy ELAN touchscreen

2014-11-17 Thread Oliver Neukum
The touchscreen needs the same quirk as the other models. Signed-off-by: Oliver Neukum Reported-by: Bryan Poling CC: stable@vger.kernel.org --- drivers/hid/hid-ids.h | 1 + drivers/hid/usbhid/hid-quirks.c | 1 + drivers/usb/core/quirks.c | 3 +++ 3 files changed, 5 insertions

Re: [PATCH] USB: cdc-acm: add quirk for control-line state requests

2014-11-07 Thread Oliver Neukum
On Fri, 2014-11-07 at 10:16 +0100, Johan Hovold wrote: > On Fri, Nov 07, 2014 at 10:05:12AM +0100, Oliver Neukum wrote: > > On Thu, 2014-11-06 at 18:08 +0100, Johan Hovold wrote: > > > Add new quirk for devices that cannot handle control-line state > > > requests

Re: [PATCH] USB: cdc-acm: add quirk for control-line state requests

2014-11-07 Thread Oliver Neukum
On Thu, 2014-11-06 at 18:08 +0100, Johan Hovold wrote: > Add new quirk for devices that cannot handle control-line state > requests. > > Note that we currently send these requests to all devices, regardless > of > whether they claim to support it, but that errors are only logged if > support is cl

Re: [PATCH] USB: cdc-acm: add device id for GW Instek AFG-2225

2014-10-30 Thread Oliver Neukum
On Thu, 2014-10-30 at 02:19 +0100, Peter Stuge wrote: > Oliver Neukum wrote: > > Then I guess I'll take no further action in kernel space. > > I for one would like the kernel messages to be less prominent, if > they stay at all. I am removing them. Regards

Re: [PATCH] USB: cdc-acm: add device id for GW Instek AFG-2225

2014-10-28 Thread Oliver Neukum
On Tue, 2014-10-28 at 11:49 -0500, Dan Williams wrote: > > Well, then I guess it is up to Dan. Would you use the exported > > capabilities? > > From a practical standpoint, I'm not it would be as useful as we all > would like, mainly because the capabilities can be wrong and kernel > changes filte

Re: [PATCH] USB: cdc-acm: add device id for GW Instek AFG-2225

2014-10-28 Thread Oliver Neukum
On Mon, 2014-10-27 at 15:35 -0500, Dan Williams wrote: > so whenever that flag gets exported, we also need to make sure that > things that the kernel says *aren't* modems, actually aren't modems. > Which we apparently get wrong right now for various Nokia devices. I > don't really trust the manufa

Re: [PATCH] USB: cdc-acm: add device id for GW Instek AFG-2225

2014-10-28 Thread Oliver Neukum
On Tue, 2014-10-28 at 10:05 +0100, Bjørn Mork wrote: > Johan Hovold writes: > > > Today, only one device has the "NOT_A_MODEM" flag (*only* to prevent one > > message during probe), and most devices are simply matched on the > > interface class fields anyway. I'm not sure we want to start registe

Re: [PATCH] USB: cdc-acm: add device id for GW Instek AFG-2225

2014-10-28 Thread Oliver Neukum
On Tue, 2014-10-28 at 08:03 +0100, Johan Hovold wrote: > Today, only one device has the "NOT_A_MODEM" flag (*only* to prevent > one > message during probe), and most devices are simply matched on the > interface class fields anyway. I'm not sure we want to start > registering > devices with broken

Re: [PATCH] USB: cdc-acm: add device id for GW Instek AFG-2225

2014-10-27 Thread Oliver Neukum
On Mon, 2014-10-27 at 19:07 +0100, Johan Hovold wrote: > I guess we could use that quirk, but I'm actually leaning towards just > removing that quirk and reducing the log level of the message to info. > > Oliver, what do you say? Now that I think about this, I'd say that we should actually expor

Re: [PATCH fix for 3.17] uas: Add a quirk for rejecting ATA_12 and ATA_16 commands

2014-09-15 Thread Oliver Neukum
On Mon, 2014-09-15 at 08:42 +, David Laight wrote: > From: Alan Stern > > > You must not add an aditional value for a module parameter without > > documenting it in Documentation/kernel-parameters.txt. > > How can this work as a 'module parameter'? It cannot. This parameter is an aid to deb

Re: [PATCH 10/21] uas: zap_pending: data urbs should have completed at this time

2014-09-10 Thread Oliver Neukum
On Wed, 2014-09-10 at 13:46 +0200, Hans de Goede wrote: > uas_log_cmd_state(cmnd, __func__); > - /* all urbs are killed, clear inflight bits */ > - cmdinfo->state &= ~(COMMAND_INFLIGHT | > - DATA_IN_URB_INFLIGHT | > -

Re: [PATCH 20/21] uas: Remove support for old sense ui as used in pre-production hardware

2014-09-10 Thread Oliver Neukum
On Wed, 2014-09-10 at 13:46 +0200, Hans de Goede wrote: > I've access to a number of different uas devices now, and none of them use > old style sense urbs. The only case where these code-paths trigger is with > the asm1051 and there they do the wrong thing, as the asm1051 sends 8 bytes > status iu

Re: [PATCH 17/21] uas: Do not log urb status error on cancellation

2014-09-10 Thread Oliver Neukum
On Wed, 2014-09-10 at 13:46 +0200, Hans de Goede wrote: > Check for both type of cancellation codes for sense and data urbs. Then you should also check for -ESHUTDOWN (unplug of HC) Regards Oliver -- To unsubscribe from this list: send the line "unsubscribe stable" in th

Re: [PATCH 03/21] uas: Fix resetting flag handling

2014-09-10 Thread Oliver Neukum
On Wed, 2014-09-10 at 13:46 +0200, Hans de Goede wrote: > - Make sure we always hold the lock when setting / checking resetting > - Check resetting before checking urb->status > - Add missing check for resetting to uas_data_cmplt > - Add missing check for resetting to uas_do_work Why is the checki

Re: [PATCH 02/21] uas: Remove task-management / abort error handling code

2014-09-10 Thread Oliver Neukum
On Wed, 2014-09-10 at 13:46 +0200, Hans de Goede wrote: > This commit removes the abort / lun-reset error handling paths, and also the > taks-mgmt code since those are the only 2 task-mgmt users. Leaving only the > (tested and testable) usb-device-reset error handling path in place. > > Note I re

Re: [PATCH 01/21] uas: replace WARN_ON_ONCE() with lockdep_assert_held()

2014-09-10 Thread Oliver Neukum
On Wed, 2014-09-10 at 14:00 +0200, Hans de Goede wrote: > Hi, > > On 09/10/2014 01:56 PM, Oliver Neukum wrote: > > On Wed, 2014-09-10 at 13:48 +0200, Hans de Goede wrote: > >> Hi, > >> > >> Note this series is NOT intended for stable, but I accidentally

Re: [PATCH 01/21] uas: replace WARN_ON_ONCE() with lockdep_assert_held()

2014-09-10 Thread Oliver Neukum
On Wed, 2014-09-10 at 13:48 +0200, Hans de Goede wrote: > Hi, > > Note this series is NOT intended for stable, but I accidentally > had "cc = stable@vger.kernel.org" in my .git/config when sending > this series, please ignore for stable. > > NACK for stable. If this is not for stable, what do yo

Re: [PATCH] devio: fix issue with log flooding

2014-08-02 Thread Oliver Neukum
On Fri, 2014-08-01 at 10:45 -0400, Alan Stern wrote: > It was a real question. You're right that this is a pretty unimportant > kind of error. The question is whether anybody cares enough to want to > fix it. I guess the answer is no. The people who might care know now. Regards

Re: [PATCH] devio: fix issue with log flooding

2014-08-01 Thread Oliver Neukum
On Fri, 2014-08-01 at 10:24 -0400, Alan Stern wrote: > On Fri, 1 Aug 2014, Oliver Neukum wrote: > > > usbfs allows user space to pass down an URB which sets URB_SHORT_NOT_OK > > for output URBs. That causes usbcore to log messages without limit > > for a nonsensical dis

[PATCH] devio: fix issue with log flooding

2014-08-01 Thread Oliver Neukum
://www.virtualbox.org/ticket/13085 Signed-off-by: Oliver Neukum CC: stable@vger.kernel.org --- drivers/usb/core/devio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 257876e..0b59731 100644 --- a/drivers/usb/core/devio.c +++ b

Re: [PATCH] usb: cdc-wdm: manage_power should always set needs_remote_wakeup

2013-12-02 Thread Oliver Neukum
On Fri, 2013-11-29 at 20:17 +0100, Bjørn Mork wrote: > Cc: > Reported-by: Oliver Neukum > Signed-off-by: Bjørn Mork Acked-by: Oliver Neukum -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majord...@vger.kernel.org More majo

Re: [PATCH 1/3] net: usb: cdc_ether: Use wwan interface for Telit modules

2013-09-16 Thread Oliver Neukum
On Mon, 2013-09-16 at 11:47 +0200, Fabio Porcedda wrote: > Signed-off-by: Fabio Porcedda > Cc: # 3.0+ as far back as it applies cleanly Acked-by: Oliver Neukum -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majord...@vger

Re: [PATCH v2] USB: cdc-wdm: fix read buffer overflow

2013-03-12 Thread Oliver Neukum
On Monday 11 March 2013 22:11:55 Bjørn Mork wrote: > > What ever was decided here? Can someone please send me the patch that > > you two agreed would solve this problem? > > I believe Oliver's patch titled "cdc-wdm: fix buffer overflow" dated > Wed, 27 Feb 2013 10:29:02 +0100 was the conclusion t

Re: [PATCH] USB: storage: fix Huawei mode switching regression

2013-03-05 Thread Oliver Neukum
On Tuesday 05 March 2013 11:07:05 Bjørn Mork wrote: > "Fangxiaozhi (Franko)" writes: > > > -- commit 200e0d99 and commit cd060956, only put the switch > > command into kernel, instead of userspace usb_modeswitch utility. > > Yes. And that is the problem. It was agreed years ago that this >

Re: [PATCH] USB: storage: fix Huawei mode switching regression

2013-03-05 Thread Oliver Neukum
On Monday 04 March 2013 23:28:47 Josua Dietze wrote: > > I guess the real problem will be verifying that all of the entries can > > go away. This type of hardware tends to get old very fast, but there is > > always someone having a really ancient device. > > I will check this and add any missing U

Re: [PATCH 1/5] USB: cdc-acm: fix device unregistration

2013-02-27 Thread Oliver Neukum
emove /2-1:3.1/tty/ttyACM0 (tty) > > The driver must deal with tty callbacks after disconnect by checking the > disconnected flag. Specifically, further opens must be prevented and > this is already implemented. > > Cc: stable > Signed-off-by: Johan Hovold Acked-by: Oliver N

Re: [PATCH v2] USB: cdc-wdm: fix read buffer overflow

2013-02-15 Thread Oliver Neukum
On Friday 15 February 2013 08:53:28 Bjørn Mork wrote: > Oliver Neukum writes: > > We have to let user space recover. To do so we need to indicate when > > exactly we dropped data. > > The problem with that is that this is likely to happen when a client > just doesn'

Re: [PATCH v2] USB: cdc-wdm: fix read buffer overflow

2013-02-14 Thread Oliver Neukum
On Thursday 14 February 2013 18:10:43 Bjørn Mork wrote: > Do not scribble past end of buffer. Check if the userspace buffer has > enough space available before attempting to move more data there. Drop > new data on overflow. > > Cc: stable > Signed-off-by: Bjørn Mork >

Re: [PATCH] USB: cdc-wdm: fix read buffer overflow

2013-02-14 Thread Oliver Neukum
On Thursday 14 February 2013 13:53:26 Bjørn Mork wrote: > Do not scribble past end of buffer. Check if the userspace buffer has > enough space available before attempting to move more data there. Throw > away all previously read data if the buffer is full. > > Cc: stable > Signed-off-by: Bjørn M

Re: [alsa-devel] [PATCH] usb: add USB_QUIRK_RESET_RESUME for M-Audio 49

2012-11-26 Thread Oliver Neukum
On Monday 26 November 2012 14:43:13 Clemens Ladisch wrote: > > If it has to be running, the easiest fix would be the patch like > > below. This will turn off the autopm essentially, but better than > > breakage. > > > > @@ -2074,6 +2077,8 @@ static void snd_usbmidi_input_start_ep(struct > > snd_

[PATCH] xhci: endianness xhci_calculate_intel_u2_timeout

2012-10-17 Thread Oliver Neukum
An le16 is accessed without conversion. Signed-off-by: Oliver Neukum CC: stable@vger.kernel.org --- drivers/usb/host/xhci.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 28d888c..75a824a 100644 --- a/drivers/usb

[PATCH] xhci: fix integer overflow

2012-10-17 Thread Oliver Neukum
xhci_service_interval_to_ns() returns long long to avoid an overflow. However, the type cast happens too late. The fix is to force ULL from the beginning. This needs to be backported to kernels as old as 3.5 Signed-off-by: Oliver Neukum CC: stable@vger.kernel.org --- drivers/usb/host/xhci.c

Re: [PATCH] usbhid: use GFP_NOIO in reset code path

2012-10-10 Thread Oliver Neukum
On Wednesday 10 October 2012 14:56:04 Jiri Kosina wrote: > On Wed, 10 Oct 2012, Oliver Neukum wrote: > > > For mice with card readers the HID driver can deadlock as its > > post_reset() method allocates memory. GFP_NOIO must be used in a block > > layer error hand

[PATCH] usbhid: use GFP_NOIO in reset code path

2012-10-10 Thread Oliver Neukum
For mice with card readers the HID driver can deadlock as its post_reset() method allocates memory. GFP_NOIO must be used in a block layer error handler, which usbhid can be indirectly part of. Signed-off-by: Oliver Neukum CC: sta...@kernel.org --- drivers/hid/hid-core.c|7

Re: [PATCH] USB: fix missed resume for auto-suspend failed interface

2012-09-20 Thread Oliver Neukum
On Thursday 20 September 2012 16:26:18 Ming Lei wrote: > On Thu, Sep 20, 2012 at 3:29 PM, Oliver Neukum wrote: > > On Thursday 20 September 2012 13:28:51 Ming Lei wrote: > >> If one usb interface driver returns failure from its > >> suspend(auto) callback inside usb_su

Re: [PATCH] USB: fix missed resume for auto-suspend failed interface

2012-09-20 Thread Oliver Neukum
On Thursday 20 September 2012 13:28:51 Ming Lei wrote: > If one usb interface driver returns failure from its > suspend(auto) callback inside usb_suspend_both, its > resume() callback should be called to recover its > working state. NO! The interface is defined so that if you fail, this is your p

Re: [PATCH v2] USB: cdc-wdm: fix lockup on error in wdm_read

2012-07-02 Thread Oliver Neukum
Cc: > Signed-off-by: Bjørn Mork Acked-by: Oliver Neukum -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] USB: cdc-wdm: fix lockup on error in wdm_read

2012-07-02 Thread Oliver Neukum
Am Montag, 2. Juli 2012, 01:08:59 schrieb Bjørn Mork: > The WDM_READ flag is normally cleared by wdm_int_callback > before resubmitting the interrupt urb. But a crashing > device may cause both a read error and cancelling all > urbs. We must make sure that the flag is cleared by > wdm_read in thi

Re: [PATCH net] cdc_ether: add Novatel USB551L device IDs for FLAG_WWAN

2012-05-07 Thread Oliver Neukum
Am Montag, 7. Mai 2012, 16:24:51 schrieb Dan Williams: > Needs to be tagged with FLAG_WWAN, which since it has generic > descriptors, won't happen if we don't override the generic > driver info. > > Cc: Oliver Neukum > Cc: stable@vger.kernel.org > Signed-off-by:

[PATCH] cdc-wdm: fix race leading leading to memory corruption

2012-04-26 Thread Oliver Neukum
>From dc42dd075c72ccc499f7ac54bd4fc807fb1cfbc2 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Thu, 26 Apr 2012 21:52:06 +0200 Subject: [PATCH] cdc-wdm: fix race leading leading to memory corruption This patch fixes a race whereby a pointer to a buffer would be overwritten while the buf

Re: [PATCH net] cdc_ether: Ignore bogus union descriptor for RNDIS devices

2012-04-26 Thread Oliver Neukum
Am Donnerstag, 26. April 2012, 12:55:03 schrieb Bjørn Mork: > Some RNDIS devices include a bogus CDC Union descriptor pointing > to non-existing interfaces. The RNDIS code is already prepared > to handle devices without a CDC Union descriptor by hardwiring > the driver to use interfaces 0 and 1, w

Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

2012-04-25 Thread Oliver Neukum
Am Mittwoch, 25. April 2012, 13:24:14 schrieb Huajun Li: > Hi, > So far, usb_unblock_urb() does same thing as usb_unpoison_urb(), so > is it possible reusing it just by adding a macro define? > A patch is welcome. Regards Oliver -- - - - SUSE LINUX Products GmbH, GF:

Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

2012-04-25 Thread Oliver Neukum
if (!hid_submit_out(hid)) > > You need to add check of "usbhid->outtail != usbhid->outhead" above. Done. Could you test? Regards Oliver >From 9ff6b78dc59c98b9844dc9922549fd338828a889 Mon Sep 17 00:00:00 2001 From: Oliver Neuku

Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

2012-04-25 Thread Oliver Neukum
Am Mittwoch, 25. April 2012, 09:02:58 schrieb Ming Lei: > On Wed, Apr 25, 2012 at 2:19 PM, Oliver Neukum wrote: > > >> @@ -546,8 +557,13 @@ static void __usbhid_submit_report(struct > >> hid_device *hid, struct hid_report *re > >>* no

Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

2012-04-25 Thread Oliver Neukum
s to me that we need to prevent resubmission and all is well. And we almost have all the infrastructure. So how about this, making it more reusable: >From ce77d793252d1abf3a0ec6c67e4a7a05ac6d846a Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Wed, 25 Apr 2012 09:54:00 +0200 Su

Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

2012-04-24 Thread Oliver Neukum
Am Mittwoch, 25. April 2012, 08:19:32 schrieb Oliver Neukum: > Am Mittwoch, 25. April 2012, 03:27:19 schrieb Ming Lei: > > @@ -546,8 +557,13 @@ static void __usbhid_submit_report(struct > > hid_device *hid, struct hid_report *re > > * no race because

Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

2012-04-24 Thread Oliver Neukum
Am Mittwoch, 25. April 2012, 03:27:19 schrieb Ming Lei: > On Wed, Apr 25, 2012 at 2:57 AM, Oliver Neukum wrote: > > usb_submit_urb() > >> > >> This submit won't happen because HID_OUT_RUNNING is not cleared. > > > > I may be dense, but as far as I

Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

2012-04-24 Thread Oliver Neukum
Am Dienstag, 24. April 2012, 17:46:41 schrieb Ming Lei: > On Tue, Apr 24, 2012 at 10:22 PM, Oliver Neukum wrote: > > Am Dienstag, 24. April 2012, 06:19:00 schrieb Ming Lei: > > > >> @@ -486,11 +494,15 @@ static void hid_ctrl(struct urb *urb) > >> > >

Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

2012-04-24 Thread Oliver Neukum
Am Montag, 23. April 2012, 17:42:11 schrieb Alan Stern: > I don't like the idea of changing the status codes. It would mean > changing usb_kill_urb too. Why? > Instead of changing return codes or adding locks, how about > implementing a small state machine for each URB? > > Initially t

Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

2012-04-24 Thread Oliver Neukum
Am Dienstag, 24. April 2012, 06:19:00 schrieb Ming Lei: > @@ -486,11 +494,15 @@ static void hid_ctrl(struct urb *urb) > > if (usbhid->ctrlhead != usbhid->ctrltail && !hid_submit_ctrl(hid)) { > /* Successfully submitted next urb in queue */ > + if (status != -ECONNR

Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

2012-04-23 Thread Oliver Neukum
Am Sonntag, 22. April 2012, 13:53:32 schrieb Ming Lei: > >> Then we can have a uniform lock requirement and no changes are involved > >> on host controller drivers. > > > > The return values would not be correct. > > If you run 'git grep -n usb_unlink_urb drivers/usb/', it may show that > most of

Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

2012-04-23 Thread Oliver Neukum
Am Sonntag, 22. April 2012, 12:51:26 schrieb Ming Lei: > On Sun, Apr 22, 2012 at 5:49 AM, Alan Stern wrote: > > Although the kerneldoc doesn't actually say so, it should be safe to > > assume that usb_unlink_urb calls the completion routine directly _only_ > > in cases where the unlink succeeded.

Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

2012-04-21 Thread Oliver Neukum
Am Samstag, 21. April 2012, 19:31:20 schrieb Alan Stern: > On Sat, 21 Apr 2012, Ming Lei wrote: > > > >> Think about what happens if the URB being unlinked hasn't been > > >> presented to the hardware yet. �Once it has been removed from the HCD's > > >> internal lists, there's no reason not to giv

Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

2012-04-21 Thread Oliver Neukum
Am Samstag, 21. April 2012, 02:37:35 schrieb Alan Stern: > On Fri, 20 Apr 2012, Oliver Neukum wrote: > > > As I said, I'd very much appreciate sane semantics for usb_unlink_urb(). > > Aside from the practicality issue of altering a large number of > existing drivers,

Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

2012-04-20 Thread Oliver Neukum
Am Freitag, 20. April 2012, 14:53:24 schrieb Ming Lei: > On Fri, Apr 20, 2012 at 6:45 PM, Oliver Neukum wrote: > > Am Freitag, 20. April 2012, 12:17:51 schrieb Ming Lei: > >> On Fri, Apr 20, 2012 at 3:57 PM, Oliver Neukum wrote: > >> > > >> > Y

Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

2012-04-20 Thread Oliver Neukum
Am Freitag, 20. April 2012, 12:17:51 schrieb Ming Lei: > On Fri, Apr 20, 2012 at 3:57 PM, Oliver Neukum wrote: > > > > You are racing with hid_irq_out(). It calls hid_submit_out() > > under lock. So if hid_irq_out() is running between dropping > > the lock and usb_un

Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

2012-04-20 Thread Oliver Neukum
Am Freitag, 20. April 2012, 04:10:09 schrieb Ming Lei: > On Fri, Apr 20, 2012 at 12:11 AM, Oliver Neukum wrote: > > Am Donnerstag, 19. April 2012, 15:51:04 schrieb Ming Lei: > >> The URB complete handler may be called by usb_unlink_urb directly, > >> so de

Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

2012-04-19 Thread Oliver Neukum
Am Donnerstag, 19. April 2012, 15:51:04 schrieb Ming Lei: > The URB complete handler may be called by usb_unlink_urb directly, > so deadlock will be triggered in __usbhid_submit_report since > usbhid->lock is to be acquired in ctrl/out URB complete handler > but it is hold before calling usb_unlink