Re: [PATCH] USB: core: prevent malicious bNumInterfaces overflow

2017-12-12 Thread Greg KH
On Wed, Dec 13, 2017 at 09:27:42AM +0800, Peter Chen wrote: > On Tue, Dec 12, 2017 at 02:25:13PM -0500, Alan Stern wrote: > > A malicious USB device with crafted descriptors can cause the kernel > > to access unallocated memory by setting the bNumInterfaces value too > > high in a configuration

Re: Add your device DWM-222 to a proper driver

2017-12-12 Thread Greg KH
On Wed, Dec 13, 2017 at 08:18:41AM +0100, martin.er...@centrum.cz wrote: > Dear linux development, > > please to add device to a proper driver. I wrote this requirement according > log list message. > > My USB modem is D-link DWM-222 > > Vendor    3G Standard    Default     Id        Modem Id  

Add your device DWM-222 to a proper driver

2017-12-12 Thread martin.ersil
Dear linux development, please to add device to a proper driver. I wrote this requirement according log list message. My USB modem is D-link DWM-222 Vendor    3G Standard    Default     Id        Modem Id    User     Modem Storage    Diag    Protocol(s) DWM-222 A1        LTE CAT4   

[PATCH 1/4] usb: renesas_usbhs: Add a function to write the UGCTRL2 register

2017-12-12 Thread Yoshihiro Shimoda
To cleanup the code, this patch adds a function to write the UGCTRL2 register. Signed-off-by: Yoshihiro Shimoda --- drivers/usb/renesas_usbhs/rcar3.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git

[PATCH 4/4] usb: renesas_usbhs: add extcon notifier to set mode for non-otg channel

2017-12-12 Thread Yoshihiro Shimoda
This patch adds extcon notifier callback to set the mode of host/peripheral by using extcon state (e.g phy-rcar-gen3-usb2) for non-otg channel (e.g. R-Car D3). Signed-off-by: Yoshihiro Shimoda --- drivers/usb/renesas_usbhs/common.c | 9 +

[PATCH 2/4] usb: renesas_usbhs: add a new callback for extcon notifier

2017-12-12 Thread Yoshihiro Shimoda
To set host/peripheral mode by using extcon notifier, this patch adds a new callback as "notifier" in renesas_usbhs_platform_callback. Signed-off-by: Yoshihiro Shimoda --- include/linux/usb/renesas_usbhs.h | 8 1 file changed, 8 insertions(+) diff

[PATCH 0/4] usb: renesas_usbhs: add extcon notifier for non-otg channel

2017-12-12 Thread Yoshihiro Shimoda
This patch set is based on the Felipe's usb.git / testing/next branch (commit id = f2830ad455ec0fdc386baeb9d654f7095bf849da). Yoshihiro Shimoda (4): usb: renesas_usbhs: Add a function to write the UGCTRL2 register usb: renesas_usbhs: add a new callback for extcon notifier usb:

[PATCH 3/4] usb: renesas_usbhs: set the mode by using extcon state for non-otg channel

2017-12-12 Thread Yoshihiro Shimoda
The usbhs_rcar3_power_and_pll_ctrl() will be used by non-otg channel (e.g. R-Car D3) and the previous code has hardcoded as peripheral mode. So, this patch sets the mode by using extcon state. If the channel doesn't get any extcon devices, this driver's behavior is the same as before.

[PATCH 1/1] usb: doc: Update document for USB3 debug port usage

2017-12-12 Thread Lu Baolu
Update Documentation/driver-api/usb/usb3-debug-port.rst. This update includes the guide for using xHCI debug capability based TTY serial link. Cc: Mathias Nyman Cc: Greg Kroah-Hartman Signed-off-by: Lu Baolu

Re: Dual-role behavior with USB-C?

2017-12-12 Thread Peter Chen
On Wed, Dec 13, 2017 at 01:17:23AM +, Takashi Matsuzawa wrote: > Hello. > > >If you have a Type-C connector on your board, then you also should > >have a USB Type-C PHY that takes care of CC logic. The host-to-device > >relationship is determined using the Configuration Channel (CC) that >

Re: Dual-role behavior with USB-C?

2017-12-12 Thread Peter Chen
On Tue, Dec 12, 2017 at 07:01:34AM +, Takashi Matsuzawa wrote: > Hello. > Thank you very much for your comment. > > > Since USB OTG FSM has not been accepted by industry during last ten years, > > we decide > > to give up maintaining OTG FSM at Linux kernel. For role switch use case, > >

Re: [PATCH] USB: chipidea: msm: fix ulpi-node lookup

2017-12-12 Thread Peter Chen
On Tue, Dec 12, 2017 at 01:59:29PM +0100, Johan Hovold wrote: > On Tue, Dec 12, 2017 at 11:08:17AM +0800, Peter Chen wrote: > > On Mon, Nov 13, 2017 at 11:12:58AM +0100, Johan Hovold wrote: > > > Fix child-node lookup during probe, which ended up searching the whole > > > device tree depth-first

Re: [PATCH] USB: core: prevent malicious bNumInterfaces overflow

2017-12-12 Thread Peter Chen
On Tue, Dec 12, 2017 at 02:25:13PM -0500, Alan Stern wrote: > A malicious USB device with crafted descriptors can cause the kernel > to access unallocated memory by setting the bNumInterfaces value too > high in a configuration descriptor. Although the value is adjusted > during parsing, this

Re: Dual-role behavior with USB-C?

2017-12-12 Thread Takashi Matsuzawa
Hello. >If you have a Type-C connector on your board, then you also should >have a USB Type-C PHY that takes care of CC logic. The host-to-device >relationship is determined using the Configuration Channel (CC) that >goes through the USB Type-C cable. Note that CC is not the same as ID! I am

Re: KASAN: use-after-free Read in __lock_acquire (2)

2017-12-12 Thread Eric Biggers
On Sat, Dec 02, 2017 at 08:08:01AM -0800, syzbot wrote: > Allocated by task 3086: > save_stack+0x43/0xd0 mm/kasan/kasan.c:447 > set_track mm/kasan/kasan.c:459 [inline] > kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551 > kmem_cache_alloc_trace+0x136/0x750 mm/slab.c:3613 > kmalloc

Re: minor bug in usbip tool

2017-12-12 Thread Greg KH
On Tue, Dec 12, 2017 at 04:04:27PM +0100, Juan Zea wrote: > Hi, > > I've being taking a deep look at the code in the usbip tool and found this > small bug at > https://github.com/torvalds/linux/blob/master/tools/usb/usbip/src/utils.c : > > 44 rc =

[PATCH] USB: core: prevent malicious bNumInterfaces overflow

2017-12-12 Thread Alan Stern
A malicious USB device with crafted descriptors can cause the kernel to access unallocated memory by setting the bNumInterfaces value too high in a configuration descriptor. Although the value is adjusted during parsing, this adjustment is skipped in one of the error return paths. This patch

Re: [PATCH] USB: core: only clean up what we allocated

2017-12-12 Thread Andrey Konovalov
On Tue, Dec 12, 2017 at 5:12 PM, Alan Stern wrote: > On Tue, 12 Dec 2017, Andrey Konovalov wrote: > >> On Tue, Dec 12, 2017 at 4:41 PM, Alan Stern >> wrote: >> > On Mon, 11 Dec 2017, Greg KH wrote: >> > >> >> From: Andrey Konovalov

Re: [PATCH v3 1/2] usb: dwc2: host: Don't retry NAKed transactions right away

2017-12-12 Thread Doug Anderson
Hi, On Tue, Dec 12, 2017 at 3:06 AM, Felipe Balbi wrote: > > Hi, > > Douglas Anderson writes: >> On rk3288-veyron devices on Chrome OS it was found that plugging in an >> Arduino-based USB device could cause the system to lockup, especially >> if the CPU

[PATCH v4] usb: dwc2: host: Don't retry NAKed transactions right away

2017-12-12 Thread Douglas Anderson
On rk3288-veyron devices on Chrome OS it was found that plugging in an Arduino-based USB device could cause the system to lockup, especially if the CPU Frequency was at one of the slower operating points (like 100 MHz / 200 MHz). Upon tracing, I found that the following was happening: * The USB

Re: [PATCH] usb: xhci: Add XHCI_TRUST_TX_LENGTH for Renesas uPD720201

2017-12-12 Thread Ard Biesheuvel
On 12 December 2017 at 16:47, Daniel Thompson wrote: > When plugging in a USB webcam I see the following message: > xhci_hcd :04:00.0: WARN Successful completion on short TX: needs > XHCI_TRUST_TX_LENGTH quirk? > handle_tx_event: 913 callbacks suppressed > > All is

[PATCH] usb: xhci: Add XHCI_TRUST_TX_LENGTH for Renesas uPD720201

2017-12-12 Thread Daniel Thompson
When plugging in a USB webcam I see the following message: xhci_hcd :04:00.0: WARN Successful completion on short TX: needs XHCI_TRUST_TX_LENGTH quirk? handle_tx_event: 913 callbacks suppressed All is quiet again with this patch (and I've done a fair but of soak testing with the camera

Re: [PATCH] USB: core: only clean up what we allocated

2017-12-12 Thread Alan Stern
On Tue, 12 Dec 2017, Andrey Konovalov wrote: > On Tue, Dec 12, 2017 at 4:41 PM, Alan Stern wrote: > > On Mon, 11 Dec 2017, Greg KH wrote: > > > >> From: Andrey Konovalov > >> > >> When cleaning up the configurations, make sure we only free the

Re: [PATCH] usb: gadget: configfs: Disallow empty function instance name

2017-12-12 Thread Alan Stern
On Tue, 12 Dec 2017, Felipe Balbi wrote: > Hi, > > Krzysztof Opasiak writes: > > On 12/12/2017 01:31 PM, Felipe Balbi wrote: > >> > >> Hi, > >> > >> Krzysztof Opasiak writes: > >>> Every function should have a type and instance name. > >>>

Re: [PATCH v4 72/73] xfs: Convert mru cache to XArray

2017-12-12 Thread Alan Stern
On Mon, 11 Dec 2017, Joe Perches wrote: > > - I don't understand the error for xa_head here: > > > > struct xarray { > > spinlock_t xa_lock; > > gfp_t xa_flags; > > void __rcu *xa_head; > > }; > > > >Do people really think that: > > > > struct

Re: [PATCH] USB: core: only clean up what we allocated

2017-12-12 Thread Andrey Konovalov
On Tue, Dec 12, 2017 at 4:41 PM, Alan Stern wrote: > On Mon, 11 Dec 2017, Greg KH wrote: > >> From: Andrey Konovalov >> >> When cleaning up the configurations, make sure we only free the number >> of configurations and interfaces that we could

Re: [PATCH] USB: core: only clean up what we allocated

2017-12-12 Thread Alan Stern
On Mon, 11 Dec 2017, Greg KH wrote: > From: Andrey Konovalov > > When cleaning up the configurations, make sure we only free the number > of configurations and interfaces that we could have allocated. > > Reported-by: Andrey Konovalov > Cc: stable

Re: [PATCH v3 14/16] phy: Add notify_speed callback

2017-12-12 Thread Manu Gautam
Hi, On 12/12/2017 5:13 PM, Kishon Vijay Abraham I wrote: > Hi, > > On Tuesday 21 November 2017 02:53 PM, Manu Gautam wrote: >> QCOM USB PHYs can monitor resume/remote-wakeup event in >> suspended state. However PHY driver must know current >> operational speed of PHY in order to set correct

[PATCH] usb: add RESET_RESUME for ELSA MicroLink 56K

2017-12-12 Thread Oliver Neukum
This modem needs this quirk to operate. It produces timeouts when resumed without reset. Signed-off-by: Oliver Neukum CC: sta...@vger.kernel.org --- drivers/usb/core/quirks.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/core/quirks.c

minor bug in usbip tool

2017-12-12 Thread Juan Zea
Hi, I've being taking a deep look at the code in the usbip tool and found this small bug at https://github.com/torvalds/linux/blob/master/tools/usb/usbip/src/utils.c : 44 rc = write_sysfs_attribute(match_busid_attr_path, command, 45sizeof(command));

Re: [PATCH] usb: gadget: configfs: Disallow empty function instance name

2017-12-12 Thread Krzysztof Opasiak
On 12/12/2017 02:16 PM, Felipe Balbi wrote: Hi, Krzysztof Opasiak writes: On 12/12/2017 01:31 PM, Felipe Balbi wrote: Hi, Krzysztof Opasiak writes: Every function should have a type and instance name. Unfortunately in most cases instance

Re: [PATCH] usb: gadget: configfs: Disallow empty function instance name

2017-12-12 Thread Felipe Balbi
Hi, Krzysztof Opasiak writes: > On 12/12/2017 01:31 PM, Felipe Balbi wrote: >> >> Hi, >> >> Krzysztof Opasiak writes: >>> Every function should have a type and instance name. >>> Unfortunately in most cases instance name was left unused and

[PATCH 4.9 086/148] usb: gadget: udc: net2280: Fix tmp reusage in net2280 driver

2017-12-12 Thread Greg Kroah-Hartman
4.9-stable review patch. If anyone has any objections, please let me know. -- From: Raz Manor [ Upstream commit ef5e2fa9f65befa12f1113c734602d2c1964d2a5 ] In the function scan_dma_completions() there is a reusage of tmp variable. That coused a wrong

Re: [PATCH] usb: gadget: configfs: Disallow empty function instance name

2017-12-12 Thread Krzysztof Opasiak
On 12/12/2017 01:31 PM, Felipe Balbi wrote: Hi, Krzysztof Opasiak writes: Every function should have a type and instance name. Unfortunately in most cases instance name was left unused and unchecked. This may lead to situations like FunctionFS device name identified

Re: [PATCH] USB: chipidea: msm: fix ulpi-node lookup

2017-12-12 Thread Johan Hovold
On Tue, Dec 12, 2017 at 11:08:17AM +0800, Peter Chen wrote: > On Mon, Nov 13, 2017 at 11:12:58AM +0100, Johan Hovold wrote: > > Fix child-node lookup during probe, which ended up searching the whole > > device tree depth-first starting at the parent rather than just matching > > on its children. >

Re: [PATCH] usb: gadget: configfs: Disallow empty function instance name

2017-12-12 Thread Felipe Balbi
Hi, Krzysztof Opasiak writes: > Every function should have a type and instance name. > Unfortunately in most cases instance name was left unused and unchecked. > This may lead to situations like FunctionFS device name identified by "" > or some misleading debug messages

[PATCH] usb: gadget: configfs: Disallow empty function instance name

2017-12-12 Thread Krzysztof Opasiak
Every function should have a type and instance name. Unfortunately in most cases instance name was left unused and unchecked. This may lead to situations like FunctionFS device name identified by "" or some misleading debug messages from TCM like: tcm: Activating To avoid this let's add a check

Re: [GIT PULL] USB fixes for v4.15-rc4

2017-12-12 Thread Felipe Balbi
Hi, Greg Kroah-Hartman writes: > On Tue, Dec 12, 2017 at 01:03:16PM +0200, Felipe Balbi wrote: >> >> Hi Greg, >> >> Only 7 changesets this time around. Nothing really major. Let me know if >> you want anything to be changed. >> >> Cheers >> >> The following

Re: [GIT PULL] USB fixes for v4.15-rc4

2017-12-12 Thread Greg Kroah-Hartman
On Tue, Dec 12, 2017 at 01:03:16PM +0200, Felipe Balbi wrote: > > Hi Greg, > > Only 7 changesets this time around. Nothing really major. Let me know if > you want anything to be changed. > > Cheers > > The following changes since commit 50c4c4e268a2d7a3e58ebb698ac74da0de40ae36: > > Linux

Re: [PATCH v3 14/16] phy: Add notify_speed callback

2017-12-12 Thread Kishon Vijay Abraham I
Hi, On Tuesday 21 November 2017 02:53 PM, Manu Gautam wrote: > QCOM USB PHYs can monitor resume/remote-wakeup event in > suspended state. However PHY driver must know current > operational speed of PHY in order to set correct polarity of > wakeup events for detection. E.g. QUSB2 PHY monitors

Re: Dual-role behavior with USB-C?

2017-12-12 Thread Heikki Krogerus
Hi Takashi, On Tue, Dec 12, 2017 at 07:01:34AM +, Takashi Matsuzawa wrote: > Hello. > Thank you very much for your comment. > > > Since USB OTG FSM has not been accepted by industry during last ten years, > > we decide > > to give up maintaining OTG FSM at Linux kernel. For role switch use

Re: [PATCH v1 2/2] usb: chipidea: tegra: Select Tegra's PHY in Kconfig

2017-12-12 Thread Dmitry Osipenko
On 12.12.2017 05:54, Peter Chen wrote: > On Mon, Dec 11, 2017 at 04:09:44PM +0300, Dmitry Osipenko wrote: >> On 11.12.2017 13:04, Thierry Reding wrote: >>> On Mon, Dec 11, 2017 at 02:10:00AM +0300, Dmitry Osipenko wrote: UDC driver won't probe without Tegra's PHY, hence select it in the

Re: [PATCH v3 1/2] usb: dwc2: host: Don't retry NAKed transactions right away

2017-12-12 Thread Felipe Balbi
Hi, Douglas Anderson writes: > On rk3288-veyron devices on Chrome OS it was found that plugging in an > Arduino-based USB device could cause the system to lockup, especially > if the CPU Frequency was at one of the slower operating points (like > 100 MHz / 200 MHz). > >

[GIT PULL] USB fixes for v4.15-rc4

2017-12-12 Thread Felipe Balbi
Hi Greg, Only 7 changesets this time around. Nothing really major. Let me know if you want anything to be changed. Cheers The following changes since commit 50c4c4e268a2d7a3e58ebb698ac74da0de40ae36: Linux 4.15-rc3 (2017-12-10 17:56:26 -0800) are available in the git repository at:

Re: [PATCH] Revert "usb: gadget: allow to enable legacy drivers without USB_ETH"

2017-12-12 Thread Felipe Balbi
Hi again, Felipe Balbi writes: > Bart Van Assche writes: >> Romain Izard reported the following about commit 7a9618a22aad: >> >> As it reached Linus' tree with v4.15-rc3, I recently noticed the >> following commit that triggered a

Re: [PATCH] Revert "usb: gadget: allow to enable legacy drivers without USB_ETH"

2017-12-12 Thread Felipe Balbi
Hi, Bart Van Assche writes: > Romain Izard reported the following about commit 7a9618a22aad: > > As it reached Linus' tree with v4.15-rc3, I recently noticed the > following commit that triggered a Kconfig request. I believe that this > change does not make

Re: [PATCH] usb: xhci: fix incorrect memset()

2017-12-12 Thread Mathias Nyman
On 11.12.2017 19:05, Arnd Bergmann wrote: On Mon, Dec 11, 2017 at 6:01 PM, Greg Kroah-Hartman wrote: On Mon, Dec 11, 2017 at 02:59:13PM +0200, Mathias Nyman wrote: On 11.12.2017 13:27, Arnd Bergmann wrote: gcc-8 warnings about the new driver using a memset with a

Re: [PATCH v3 07/16] phy: qcom-qusb2: Add support for different register layouts

2017-12-12 Thread Manu Gautam
Hi Vivek, On 12/5/2017 3:53 PM, Vivek Gautam wrote: > > > On 11/21/2017 02:53 PM, Manu Gautam wrote: >> New version of QUSB2 PHY has some registers offset changed. >> Add support to have register layout for a target and update >> the same in phy_configuration. >> >> Signed-off-by: Manu Gautam

[PATCH 2/2] usb: host: xhci-plat: enable XHCI_MISSING_CAS if platform requested

2017-12-12 Thread Li Jun
In case there is CAS missing if device plugged in S3, we can use 'usb3-resume-missing-cas' device property to enable quirk flag XHCI_MISSING_CAS. Signed-off-by: Li Jun --- drivers/usb/host/xhci-plat.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH 1/2] dt-bindings: usb-xhci: add usb3-resume-missing-cas property

2017-12-12 Thread Li Jun
Adding 'usb3-resume-missing-cas' property to enable XHCI_MISSING_CAS quirk flag in case there is CAS missing if device plugged in S3. Signed-off-by: Li Jun --- Documentation/devicetree/bindings/usb/usb-xhci.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git