Re: [PATCH v10 5/6] usb:cdns3 Add Cadence USB3 DRD Driver

2019-08-13 Thread Chunfeng Yun
On Mon, 2019-08-12 at 16:04 +0300, Roger Quadros wrote: > > On 12/08/2019 15:46, Felipe Balbi wrote: > > > > Hi, > > > > Roger Quadros writes: > >>> The sysfs file we expose from the class for the role switches is > >>> primarily meant for supporting proprietary protocols that require us > >>>

Re: [PATCH] media: em28xx: modules workqueue not inited for 2nd device

2019-08-13 Thread Sean Young
On Mon, Aug 12, 2019 at 10:21:39AM -0300, Ezequiel Garcia wrote: > On Sun, 2019-08-11 at 06:11 +0100, Sean Young wrote: > > syzbot reports an error on flush_request_modules() for the second device. > > This workqueue was never initialised so simply remove the offending line. > > > > usb 1-1: USB d

Re: WARNING in usbhid_raw_request/usb_submit_urb

2019-08-13 Thread Dmitry Vyukov
On Tue, Aug 13, 2019 at 6:27 AM Hillf Danton wrote: > > [respin with the mess in Cc list cleaned up] > > On Mon, 12 Aug 2019 06:03:01 -0700 > > Hello, > > > > syzbot has tested the proposed patch but the reproducer still triggered > > crash: > > KASAN: invalid-free in hcd_buffer_free > > > > usb

Re: [PATCH v10 5/6] usb:cdns3 Add Cadence USB3 DRD Driver

2019-08-13 Thread Roger Quadros
On 13/08/2019 10:30, Chunfeng Yun wrote: > On Mon, 2019-08-12 at 16:04 +0300, Roger Quadros wrote: >> >> On 12/08/2019 15:46, Felipe Balbi wrote: >>> >>> Hi, >>> >>> Roger Quadros writes: > The sysfs file we expose from the class for the role switches is > primarily meant for supporting

Re: WARNING in usbhid_raw_request/usb_submit_urb

2019-08-13 Thread Oliver Neukum
Am Dienstag, den 13.08.2019, 12:26 +0800 schrieb Hillf Danton: > [respin with the mess in Cc list cleaned up] > Followup of commit e3e14de50dff ("HID: fix start/stop cycle in usbhid driver") > > --- a/drivers/hid/usbhid/hid-core.c > +++ b/drivers/hid/usbhid/hid-core.c > @@ -1214,6 +1214,8 @@ stat

Re: [PATCH v10 0/6] Introduced new Cadence USBSS DRD Driver.

2019-08-13 Thread Pavel Machek
Hi! > I think that I understand your concerns. My idea was not to expand the > supported > dr_mode. Rather I wanted to have possibility to limit this (only for > testing). > > Eg. > If cdns->dr_mode = USB_DR_MODE_OTG > then we can limit mode to HOST or DEVICE or DRD > if cdns->dr_mode == US

Re: [PATCH v10 5/6] usb:cdns3 Add Cadence USB3 DRD Driver

2019-08-13 Thread Chunfeng Yun
On Tue, 2019-08-13 at 10:48 +0300, Roger Quadros wrote: > > On 13/08/2019 10:30, Chunfeng Yun wrote: > > On Mon, 2019-08-12 at 16:04 +0300, Roger Quadros wrote: > >> > >> On 12/08/2019 15:46, Felipe Balbi wrote: > >>> > >>> Hi, > >>> > >>> Roger Quadros writes: > > The sysfs file we expose fr

Re: [PATCH] USB: serial: ftdi_sio: add support for FT232H CBUS gpios

2019-08-13 Thread Johan Hovold
On Thu, Aug 08, 2019 at 10:23:48PM +, Matthew Michilot wrote: > Enable support for cbus gpios on FT232H. The cbus configuration is > stored in one word in the EEPROM at byte-offset 0x1a with the mux It seems to be stored in two words. > config for ACBUS5, ACBUS6, ACBUS8 and ACBUS9 (only pins

Re: [PATCH] USB: serial: ftdi_sio: add support for FT232H CBUS gpios

2019-08-13 Thread Johan Hovold
On Thu, Aug 08, 2019 at 10:23:48PM +, Matthew Michilot wrote: > Enable support for cbus gpios on FT232H. The cbus configuration is > stored in one word in the EEPROM at byte-offset 0x1a with the mux > config for ACBUS5, ACBUS6, ACBUS8 and ACBUS9 (only pins that can be > configured as I/O mode).

Re: [PATCH] media: em28xx: modules workqueue not inited for 2nd device

2019-08-13 Thread Sean Young
Hi Brad, On Mon, Aug 12, 2019 at 10:21:39AM -0300, Ezequiel Garcia wrote: > On Sun, 2019-08-11 at 06:11 +0100, Sean Young wrote: > > syzbot reports an error on flush_request_modules() for the second device. > > This workqueue was never initialised so simply remove the offending line. > > > > usb

Re: KASAN: slab-out-of-bounds Read in usbnet_generic_cdc_bind

2019-08-13 Thread Oliver Neukum
Am Montag, den 12.08.2019, 14:27 +0200 schrieb Andrey Konovalov: > On > This one is funny, we do sizeof(struct usb_cdc_mdlm_desc *) instead of > sizeof(struct usb_cdc_mdlm_desc) and the same for > usb_cdc_mdlm_detail_desc in cdc_parse_cdc_header(). You are right. Old copy & paste error presumably.

[PATCH] USB: CDC: fix sanity checks in CDC union parser

2019-08-13 Thread Oliver Neukum
A few checks checked for the size of the pointer to a structure instead of the structure itself. Copy & paste issue presumably. Fixes: e4c6fb7794982 ("usbnet: move the CDC parser into USB core") Reported-by: syzbot+45a53506b65321c1f...@syzkaller.appspotmail.com Signed-off-by: Oliver Neukum --- d

Re: Fwd: Re: New USB Device

2019-08-13 Thread Johan Hovold
On Wed, Jul 31, 2019 at 07:32:29PM +0200, Markus Breunig wrote: > > > Am 16.07.2019 um 11:23 schrieb Johan Hovold: > > [ Pleas avoid top posting. ] > > > > On Sun, Jul 07, 2019 at 09:38:00PM +0200, Markus Breunig wrote: > >> Hi Greg, > >> > >> also the company GNS has a fragmented homepage, the h

[PATCH] usb: typec: fusb302: Call fusb302_debugfs_init earlier

2019-08-13 Thread Hans de Goede
tcpm_register_port() will call some of the fusb302 code's callbacks wich in turn will call fusb302_log(). So we need to call fusb302_debugfs_init() before we call tcpm_register_port(). This fixes the following warning, which was caused by the logbuffer_lock not yet being initialized (which is done

Re: [Patch V6 7/8] usb: gadget: Add UDC driver for tegra XUSB device mode controller

2019-08-13 Thread Nagarjuna Kristam
On 12-08-2019 18:13, Chunfeng Yun wrote: > On Thu, 2019-08-08 at 15:07 +0530, Nagarjuna Kristam wrote: >> This patch adds UDC driver for tegra XUSB 3.0 device mode controller. >> XUSB device mode controller supports SS, HS and FS modes >> >> Based on work by: >> Mark Kuo >> Hui Fu >> And

Re: [PATCH] xhci: wait CNR when doing xhci resume

2019-08-13 Thread Mathias Nyman
On 12.8.2019 11.19, Oliver Neukum wrote: Am Montag, den 12.08.2019, 15:24 +0800 schrieb Rick Tseng: From: Rick NVIDIA 3.1 xHCI card would lose power when moving power state into D3Cold. Thus we need to wait CNR bit to clear when xhci resmue as xhci init. Should any controller have CNR set? W

Re: 5.2.x kernel: WD 8TB USB Drives: Unaligned partial completion (resid=78, sector_sz=512)

2019-08-13 Thread Damien Le Moal
On 2019/08/12 19:12, Martin K. Petersen wrote: > > Justin, > >>> Attached 2 x brand new Western Digital 8TB USB 3.0 drives awhile back >>> and ran some file copy tests and was getting these warnings-- is >>> there any way to avoid these warnings? I did confirm with parted >>> that the partition

Re: [PATCH] usb: typec: fusb302: Call fusb302_debugfs_init earlier

2019-08-13 Thread Heikki Krogerus
Hi Hans, On Tue, Aug 13, 2019 at 12:15:24PM +0200, Hans de Goede wrote: > tcpm_register_port() will call some of the fusb302 code's callbacks > wich in turn will call fusb302_log(). So we need to call > fusb302_debugfs_init() before we call tcpm_register_port(). > > This fixes the following warni

[PATCH next v9 11/11] usb: mtu3: register a USB Role Switch for dual role mode

2019-08-13 Thread Chunfeng Yun
Because extcon is not allowed for new bindings, and the dual role switch is supported by USB Role Switch, especially for Type-C drivers, so register a USB Role Switch to support the new way Signed-off-by: Chunfeng Yun --- v5~v9 no changes v4 changes: 1. assign fwnode member of usb_role_switch

[PATCH next v9 06/11] device connection: Add fwnode_connection_find_match()

2019-08-13 Thread Chunfeng Yun
From: Heikki Krogerus The fwnode_connection_find_match() function is exactly the same as device_connection_find_match(), except it takes struct fwnode_handle as parameter instead of struct device. That allows locating device connections before the device entries have been created. Suggested-by:

[PATCH next v9 04/11] dt-bindings: usb: mtu3: add properties about USB Role Switch

2019-08-13 Thread Chunfeng Yun
Now the USB Role Switch is supported, so add properties about it, and modify some description related. Signed-off-by: Chunfeng Yun Reviewed-by: Rob Herring --- v6~v9 no changes v5 changes: 1. modify decription about extcon and vbus-supply properties 2. make this patch depend on [1] [1]: [v3

[PATCH next v9 00/11] add USB GPIO based connection detection driver

2019-08-13 Thread Chunfeng Yun
Because the USB Connector is introduced and the requirement of usb-connector.txt binding, the old way using extcon to support USB Dual-Role switch is now deprecated, meanwhile there is no available common driver when use Type-B connector, typically using an input GPIO to detect USB ID pin. This pat

[PATCH next v9 02/11] dt-bindings: connector: add optional properties for Type-B

2019-08-13 Thread Chunfeng Yun
Add id-gpios, vbus-gpios, vbus-supply and pinctrl properties for usb-b-connector Signed-off-by: Chunfeng Yun Reviewed-by: Rob Herring --- v6~v9 no changes v5 changes: 1. add reviewed by Rob v4 no changes v3 changes: 1. add GPIO direction, and use fixed-regulator for GPIO controlled VBUS

[PATCH next v9 07/11] usb: roles: Add fwnode_usb_role_switch_get() function

2019-08-13 Thread Chunfeng Yun
From: Heikki Krogerus The fwnode_usb_role_switch_get() function is exactly the same as usb_role_switch_get(), except that it takes struct fwnode_handle as parameter instead of struct device. Suggested-by: Heikki Krogerus Signed-off-by: Chunfeng Yun Tested-by: Biju Das --- v9: replace signed-

[PATCH next v9 03/11] dt-bindings: usb: add binding for USB GPIO based connection detection driver

2019-08-13 Thread Chunfeng Yun
It's used to support dual role switch via GPIO when use Type-B receptacle, typically the USB ID pin is connected to an input GPIO, and also used to enable/disable device when the USB Vbus pin is connected to an input GPIO. Signed-off-by: Chunfeng Yun --- v9 no changes v8 changes: 1. rename the

[PATCH next v9 10/11] usb: common: add USB GPIO based connection detection driver

2019-08-13 Thread Chunfeng Yun
Due to the requirement of usb-connector.txt binding, the old way using extcon to support USB Dual-Role switch is now deprecated when use Type-B connector. This patch introduces a USB GPIO based connection detection driver, used to support Type-B connector which typically uses an input GPIO to detec

[PATCH next v9 09/11] usb: common: create Kconfig file

2019-08-13 Thread Chunfeng Yun
Create Kconfig file for USB common core, and move USB_LED_TRIG and USB_ULPI_BUS configs into the new file from the parent Kconfig, it will help to add new configs later. Signed-off-by: Chunfeng Yun --- v9 no changes v8: new patch --- drivers/usb/Kconfig| 35 +--

[PATCH next v9 08/11] usb: roles: get usb-role-switch from parent

2019-08-13 Thread Chunfeng Yun
when the USB host controller is the parent of the connector, usually type-B, sometimes don't need the graph, so we should check whether it's parent registers usb-role-switch or not firstly, and get it if exists. Suggested-by: Heikki Krogerus Signed-off-by: Chunfeng Yun --- v9: 1. replace signe

[PATCH next v9 01/11] dt-binding: usb: add usb-role-switch property

2019-08-13 Thread Chunfeng Yun
Add a property usb-role-switch to tell the driver that use USB Role Switch framework to handle the role switch, it's useful when the driver has already supported other ways, such as extcon framework etc. Cc: Biju Das Cc: Yu Chen Signed-off-by: Chunfeng Yun Reviewed-by: Rob Herring Reviewed-by:

[PATCH next v9 05/11] usb: roles: Introduce stubs for the exiting functions in role.h

2019-08-13 Thread Chunfeng Yun
From: Yu Chen This patch adds stubs for the exiting functions while CONFIG_USB_ROLE_SWITCH does not enabled. Cc: Greg Kroah-Hartman Cc: Heikki Krogerus Cc: Hans de Goede Cc: Andy Shevchenko Cc: John Stultz Reviewed-by: Heikki Krogerus Signed-off-by: Yu Chen Signed-off-by: Chunfeng Yun --

Re: [PATCH] usb: typec: fusb302: Call fusb302_debugfs_init earlier

2019-08-13 Thread Hans de Goede
Hi Heikki, On 13-08-19 12:52, Heikki Krogerus wrote: Hi Hans, On Tue, Aug 13, 2019 at 12:15:24PM +0200, Hans de Goede wrote: tcpm_register_port() will call some of the fusb302 code's callbacks wich in turn will call fusb302_log(). So we need to call fusb302_debugfs_init() before we call tcpm_r

[PATCH v2 02/10] export: explicitly align struct kernel_symbol

2019-08-13 Thread Matthias Maennich
This change allows growing struct kernel_symbol without wasting bytes to alignment. It also concretized the alignment of ksymtab entries if relative references are used for ksymtab entries. struct kernel_symbol was already implicitly being aligned to the word size, except on x86_64 and m68k, where

[PATCH v2 03/10] module: add support for symbol namespaces.

2019-08-13 Thread Matthias Maennich
The EXPORT_SYMBOL_NS() and EXPORT_SYMBOL_NS_GPL() macros can be used to export a symbol to a specific namespace. There are no _GPL_FUTURE and _UNUSED variants because these are currently unused, and I'm not sure they are necessary. I didn't add EXPORT_SYMBOL_NS() for ASM exports; this patch sets

[PATCH v2 01/10] module: support reading multiple values per modinfo tag

2019-08-13 Thread Matthias Maennich
Similar to modpost's get_next_modinfo(), introduce get_next_modinfo() in kernel/module.c to acquire any further values associated with the same modinfo tag name. That is useful for any tags that have multiple occurrences (such as 'alias'), but is in particular introduced here as part of the symbol

[PATCH v2 04/10] modpost: add support for symbol namespaces

2019-08-13 Thread Matthias Maennich
Add support for symbols that are exported into namespaces. For that, extract any namespace suffix from the symbol name. In addition, emit a warning whenever a module refers to an exported symbol without explicitly importing the namespace that it is defined in. This patch consistently adds the names

[PATCH v2 06/10] export: allow definition default namespaces in Makefiles or sources

2019-08-13 Thread Matthias Maennich
To avoid excessive usage of EXPORT_SYMBOL_NS(sym, MY_NAMESPACE), where MY_NAMESPACE will always be the namespace we are exporting to, allow exporting all definitions of EXPORT_SYMBOL() and friends by defining DEFAULT_SYMBOL_NAMESPACE. For example, to export all symbols defined in usb-common into t

[PATCH v2 05/10] module: add config option MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS

2019-08-13 Thread Matthias Maennich
If MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is enabled (default=n), the requirement for modules to import all namespaces that are used by the module is relaxed. Enabling this option effectively allows (invalid) modules to be loaded while only a warning is emitted. Disabling this option keeps the en

[PATCH v2 07/10] modpost: add support for generating namespace dependencies

2019-08-13 Thread Matthias Maennich
This patch adds an option to modpost to generate a .ns_deps file per module, containing the namespace dependencies for that module. E.g. if the linked module my-module.ko would depend on the symbol myfunc.MY_NS in the namespace MY_NS, the my-module.ns_deps file created by modpost would contain the

[PATCH v2 0/10] Symbol namespaces - RFC

2019-08-13 Thread Matthias Maennich
As of Linux 5.3-rc4, there are 31203 [1] exported symbols in the kernel. That is a growth of almost 1000 symbols since 4.17 (30206 [2]). There seems to be some consensus amongst kernel devs that the export surface is too large, and hard to reason about. Generally, these symbols fall in one of the

[PATCH v2 08/10] scripts: Coccinelle script for namespace dependencies.

2019-08-13 Thread Matthias Maennich
A script that uses the '.ns_deps' file generated by modpost to automatically add the required symbol namespace dependencies to each module. Usage: 1) Move some symbols to a namespace with EXPORT_SYMBOL_NS() or define DEFAULT_SYMBOL_NAMESPACE 2) Run 'make' (or 'make modules') and get warnings ab

[PATCH v2 09/10] usb-storage: remove single-use define for debugging

2019-08-13 Thread Matthias Maennich
USB_STORAGE was defined as "usb-storage: " and used in a single location as argument to printk. In order to be able to use the name 'USB_STORAGE', drop the definition and use the string directly for the printk call. Signed-off-by: Matthias Maennich --- drivers/usb/storage/debug.h| 2 -- driv

[PATCH v2 10/10] RFC: usb-storage: export symbols in USB_STORAGE namespace

2019-08-13 Thread Matthias Maennich
Modules using these symbols are required to explicitly import the namespace. This patch was generated with the following steps and serves as a reference to use the symbol namespace feature: 1) Define DDEFAULT_SYMBOL_NAMESPACE in the corresponding Makefile 2) make (see warnings during modpost ab

Re: KASAN: use-after-free Read in __video_do_ioctl

2019-08-13 Thread Andrey Konovalov
On Sun, Apr 14, 2019 at 10:06 PM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:9a33b369 usb-fuzzer: main usb gadget fuzzer driver > git tree: https://github.com/google/kasan/tree/usb-fuzzer > console output: https://syzkaller.appspot.com/x/log.txt?x=13

Re: KASAN: use-after-free Read in v4l2_ioctl

2019-08-13 Thread Andrey Konovalov
On Sun, Apr 14, 2019 at 10:06 PM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:9a33b369 usb-fuzzer: main usb gadget fuzzer driver > git tree: https://github.com/google/kasan/tree/usb-fuzzer > console output: https://syzkaller.appspot.com/x/log.txt?x=13

Re: [PATCH v2 08/10] scripts: Coccinelle script for namespace dependencies.

2019-08-13 Thread Julia Lawall
On Tue, 13 Aug 2019, Matthias Maennich wrote: > A script that uses the '.ns_deps' file generated by modpost to > automatically add the required symbol namespace dependencies to each > module. > > Usage: > 1) Move some symbols to a namespace with EXPORT_SYMBOL_NS() or define >DEFAULT_SYMBOL_

RE: [PATCH] xhci: wait CNR when doing xhci resume

2019-08-13 Thread Rick Tseng
Hi Mathias, Thanks for suggestion. The reason I do not use xhci_handshake() is we get build fail when configuring below as module: USB_XHCI_HCD = m USB_XHCI_PCI = m Fail message as below: ERROR: "xhci_handshake" [drivers/usb/host/xhci-pci.ko] undefined! So I write my own function to check CNR.

RE: [PATCH] xhci: wait CNR when doing xhci resume

2019-08-13 Thread Felipe Balbi
(no top-posting, please) Hi, Rick Tseng writes: > Hi Mathias, > > Thanks for suggestion. > The reason I do not use xhci_handshake() is we get build fail when > configuring below as module: > USB_XHCI_HCD = m > USB_XHCI_PCI = m > > Fail message as below: > ERROR: "xhci_handshake" [drivers/usb

Re: [PATCH v2 01/10] module: support reading multiple values per modinfo tag

2019-08-13 Thread Greg KH
On Tue, Aug 13, 2019 at 01:16:58PM +0100, Matthias Maennich wrote: > Similar to modpost's get_next_modinfo(), introduce get_next_modinfo() in > kernel/module.c to acquire any further values associated with the same > modinfo tag name. That is useful for any tags that have multiple > occurrences (su

Re: [PATCH v2 02/10] export: explicitly align struct kernel_symbol

2019-08-13 Thread Greg KH
On Tue, Aug 13, 2019 at 01:16:59PM +0100, Matthias Maennich wrote: > This change allows growing struct kernel_symbol without wasting bytes to > alignment. It also concretized the alignment of ksymtab entries if > relative references are used for ksymtab entries. > > struct kernel_symbol was alread

Re: KASAN: use-after-free Read in device_release_driver_internal

2019-08-13 Thread Andrey Konovalov
On Thu, Aug 8, 2019 at 4:00 PM Alan Stern wrote: > > On Thu, 8 Aug 2019, Andrey Konovalov wrote: > > > On Thu, Aug 8, 2019 at 2:44 PM Dmitry Vyukov wrote: > > > > > > On Thu, Aug 8, 2019 at 2:28 PM Andrey Konovalov > > > wrote: > > > > > > > > On Wed, Aug 7, 2019 at 8:31 PM Alan Stern > > > >

Re: [PATCH v2 09/10] usb-storage: remove single-use define for debugging

2019-08-13 Thread Greg KH
On Tue, Aug 13, 2019 at 01:17:06PM +0100, Matthias Maennich wrote: > USB_STORAGE was defined as "usb-storage: " and used in a single location > as argument to printk. In order to be able to use the name > 'USB_STORAGE', drop the definition and use the string directly for the > printk call. > > Sig

Re: KMSAN: uninit-value in smsc75xx_bind

2019-08-13 Thread Oliver Neukum
Am Freitag, den 09.08.2019, 01:48 -0700 schrieb syzbot: > Hello, > > syzbot found the following crash on: > > HEAD commit:beaab8a3 fix KASAN build > git tree: kmsan [..] > Call Trace: > __dump_stack lib/dump_stack.c:77 [inline] > dump_stack+0x191/0x1f0 lib/dump_stack.c:113 > kmsa

Re: [PATCH v2 08/10] scripts: Coccinelle script for namespace dependencies.

2019-08-13 Thread Greg KH
On Tue, Aug 13, 2019 at 01:17:05PM +0100, Matthias Maennich wrote: > A script that uses the '.ns_deps' file generated by modpost to > automatically add the required symbol namespace dependencies to each > module. > > Usage: > 1) Move some symbols to a namespace with EXPORT_SYMBOL_NS() or define >

Re: [PATCH v2 10/10] RFC: usb-storage: export symbols in USB_STORAGE namespace

2019-08-13 Thread Greg KH
On Tue, Aug 13, 2019 at 01:17:07PM +0100, Matthias Maennich wrote: > Modules using these symbols are required to explicitly import the > namespace. This patch was generated with the following steps and serves > as a reference to use the symbol namespace feature: > > 1) Define DDEFAULT_SYMBOL_NAME

Re: [PATCH v2 10/10] RFC: usb-storage: export symbols in USB_STORAGE namespace

2019-08-13 Thread Greg KH
On Tue, Aug 13, 2019 at 01:17:07PM +0100, Matthias Maennich wrote: > Modules using these symbols are required to explicitly import the > namespace. This patch was generated with the following steps and serves > as a reference to use the symbol namespace feature: > > 1) Define DDEFAULT_SYMBOL_NAME

Re: KASAN: use-after-free Read in ds_probe

2019-08-13 Thread Andrey Konovalov
On Sun, Apr 14, 2019 at 10:06 PM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:9a33b369 usb-fuzzer: main usb gadget fuzzer driver > git tree: https://github.com/google/kasan/tree/usb-fuzzer > console output: https://syzkaller.appspot.com/x/log.txt?x=15

Re: KASAN: slab-out-of-bounds Read in hex_string

2019-08-13 Thread Andrey Konovalov
On Tue, Apr 30, 2019 at 4:13 PM Alan Stern wrote: > > On Mon, 29 Apr 2019, Eric Biggers wrote: > > > On Mon, Apr 29, 2019 at 04:07:04PM -0400, Alan Stern wrote: > > > > Accessing beyond the end of the descriptor. > > > > > > #syz test: https://github.com/google/kasan.git usb-fuzzer > > > > > > ---

Re: KASAN: use-after-free Write in v4l2_prio_close

2019-08-13 Thread Andrey Konovalov
On Mon, Jun 3, 2019 at 1:41 PM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:69bbe8c7 usb-fuzzer: main usb gadget fuzzer driver > git tree: https://github.com/google/kasan.git usb-fuzzer > console output: https://syzkaller.appspot.com/x/log.txt?x=142ef

Re: KASAN: use-after-free Write in v4l2_device_release

2019-08-13 Thread Andrey Konovalov
On Mon, Apr 29, 2019 at 2:06 PM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:43151d6c usb-fuzzer: main usb gadget fuzzer driver > git tree: https://github.com/google/kasan/tree/usb-fuzzer > console output: https://syzkaller.appspot.com/x/log.txt?x=13f

Re: KASAN: use-after-free Read in v4l2_fh_del

2019-08-13 Thread Andrey Konovalov
On Thu, May 2, 2019 at 2:36 PM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:43151d6c usb-fuzzer: main usb gadget fuzzer driver > git tree: https://github.com/google/kasan.git usb-fuzzer > console output: https://syzkaller.appspot.com/x/log.txt?x=145cd

Re: [PATCH next v9 07/11] usb: roles: Add fwnode_usb_role_switch_get() function

2019-08-13 Thread Heikki Krogerus
On Tue, Aug 13, 2019 at 07:27:10PM +0800, Chunfeng Yun wrote: > From: Heikki Krogerus > > The fwnode_usb_role_switch_get() function is exactly the > same as usb_role_switch_get(), except that it takes struct > fwnode_handle as parameter instead of struct device. > > Suggested-by: Heikki Krogerus

Re: general protection fault in cdev_del

2019-08-13 Thread Andrey Konovalov
On Tue, May 28, 2019 at 12:48 PM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:69bbe8c7 usb-fuzzer: main usb gadget fuzzer driver > git tree: https://github.com/google/kasan.git usb-fuzzer > console output: https://syzkaller.appspot.com/x/log.txt?x=178

Re: USB fuzzing with syzbot

2019-08-13 Thread Andrey Konovalov
On Wed, Apr 17, 2019 at 6:33 PM Andrey Konovalov wrote: > > Hi, > > As you might have noticed, syzbot has started reporting bugs in the > USB subsystem that can be triggered externally by a malicious USB > device. Right now the fuzzing is done via a GadgetFS-like interface to > emulate USB devices

Re: [PATCH] xhci: wait CNR when doing xhci resume

2019-08-13 Thread Mathias Nyman
Hi, Rick Tseng writes: Hi Mathias, Thanks for suggestion. The reason I do not use xhci_handshake() is we get build fail when configuring below as module: USB_XHCI_HCD = m USB_XHCI_PCI = m Fail message as below: ERROR: "xhci_handshake" [drivers/usb/host/xhci-pci.ko] undefined! So I write my

Re: INFO: trying to register non-static key in usbtouch_reset_resume

2019-08-13 Thread Andrey Konovalov
On Thu, Jun 20, 2019 at 11:33 AM syzbot wrote: > > syzbot has found a reproducer for the following crash on: > > HEAD commit:9939f56e usb-fuzzer: main usb gadget fuzzer driver > git tree: https://github.com/google/kasan.git usb-fuzzer > console output: https://syzkaller.appspot.com/x/log

Re: INFO: trying to register non-static key in usbtouch_open

2019-08-13 Thread Andrey Konovalov
On Tue, Jul 23, 2019 at 2:48 PM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:6a3599ce usb-fuzzer: main usb gadget fuzzer driver > git tree: https://github.com/google/kasan.git usb-fuzzer > console output: https://syzkaller.appspot.com/x/log.txt?x=1633

Re: [PATCH v2 09/10] usb-storage: remove single-use define for debugging

2019-08-13 Thread Greg KH
On Tue, Aug 13, 2019 at 02:42:59PM +0200, Greg KH wrote: > On Tue, Aug 13, 2019 at 01:17:06PM +0100, Matthias Maennich wrote: > > USB_STORAGE was defined as "usb-storage: " and used in a single location > > as argument to printk. In order to be able to use the name > > 'USB_STORAGE', drop the defin

Re: WARNING in usbtouch_reset_resume

2019-08-13 Thread Andrey Konovalov
On Mon, Aug 5, 2019 at 1:58 PM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:e96407b4 usb-fuzzer: main usb gadget fuzzer driver > git tree: https://github.com/google/kasan.git usb-fuzzer > console output: https://syzkaller.appspot.com/x/log.txt?x=1104b

Re: general protection fault in cdev_del

2019-08-13 Thread syzbot
Hello, syzbot has tested the proposed patch but the reproducer still triggered crash: KASAN: use-after-free Read in hso_free_interface == BUG: KASAN: use-after-free in hso_free_interface+0x3f2/0x4f0 drivers/net/usb/hso.c:3108

Re: general protection fault in cdev_del

2019-08-13 Thread Andrey Konovalov
On Tue, Aug 13, 2019 at 3:16 PM syzbot wrote: > > Hello, > > syzbot has tested the proposed patch but the reproducer still triggered > crash: > KASAN: use-after-free Read in hso_free_interface > > == > BUG: KASAN: use-after-free in hs

Re: KASAN: use-after-free Read in device_release_driver_internal

2019-08-13 Thread Oliver Neukum
Am Dienstag, den 13.08.2019, 14:42 +0200 schrieb Andrey Konovalov: > > [..] > On Thu, Aug 8, 2019 at 4:00 PM Alan Stern wrote: > > Ah, that looks right, thank you. The patch worked correctly -- good > > work Oliver! > > Great! Just a reminder to submit the fix :) I did last week: https://pa

Re: [PATCH] usb: typec: fusb302: Call fusb302_debugfs_init earlier

2019-08-13 Thread Heikki Krogerus
On Tue, Aug 13, 2019 at 02:13:45PM +0200, Hans de Goede wrote: > Hi Heikki, > > On 13-08-19 12:52, Heikki Krogerus wrote: > > Hi Hans, > > > > On Tue, Aug 13, 2019 at 12:15:24PM +0200, Hans de Goede wrote: > > > tcpm_register_port() will call some of the fusb302 code's callbacks > > > wich in tur

Re: KASAN: global-out-of-bounds Read in dvb_pll_attach

2019-08-13 Thread Andrey Konovalov
On Wed, Jul 17, 2019 at 2:29 PM syzbot wrote: > > Hello, > > syzbot has tested the proposed patch and the reproducer did not trigger > crash: > > Reported-and-tested-by: > syzbot+8a8f48672560c8ca5...@syzkaller.appspotmail.com > > Tested on: > > commit: 6a3599ce usb-fuzzer: main usb gadget

Re: KASAN: use-after-free Read in device_release_driver_internal

2019-08-13 Thread Andrey Konovalov
On Tue, Aug 13, 2019 at 3:22 PM Oliver Neukum wrote: > > Am Dienstag, den 13.08.2019, 14:42 +0200 schrieb Andrey Konovalov: > > > > > > [..] > > > On Thu, Aug 8, 2019 at 4:00 PM Alan Stern wrote: > > > Ah, that looks right, thank you. The patch worked correctly -- good > > > work Oliver! > > > >

Re: KASAN: slab-out-of-bounds Read in p54u_load_firmware_cb

2019-08-13 Thread Andrey Konovalov
On Thu, Jun 20, 2019 at 9:46 PM Alan Stern wrote: > > On Wed, 19 Jun 2019, syzbot wrote: > > > syzbot has found a reproducer for the following crash on: > > > > HEAD commit:9939f56e usb-fuzzer: main usb gadget fuzzer driver > > git tree: https://github.com/google/kasan.git usb-fuzzer > >

Re: [PATCH] usb: typec: fusb302: Call fusb302_debugfs_init earlier

2019-08-13 Thread Guenter Roeck
On 8/13/19 3:52 AM, Heikki Krogerus wrote: Hi Hans, On Tue, Aug 13, 2019 at 12:15:24PM +0200, Hans de Goede wrote: tcpm_register_port() will call some of the fusb302 code's callbacks wich in turn will call fusb302_log(). So we need to call fusb302_debugfs_init() before we call tcpm_register_por

Re: [EXT] INFO: trying to register non-static key in del_timer_sync (2)

2019-08-13 Thread Andrey Konovalov
On Wed, Jun 12, 2019 at 6:03 PM Ganapathi Bhat wrote: > > Hi Dmitry, > > We have a patch to fix this: https://patchwork.kernel.org/patch/10990275/ Hi Ganapathi, Has this patch been accepted anywhere? This bug is still open on syzbot. Thanks!

Re: KASAN: user-memory-access Read in hidraw_ioctl

2019-08-13 Thread Andrey Konovalov
On Tue, Jul 30, 2019 at 2:28 PM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:7f7867ff usb-fuzzer: main usb gadget fuzzer driver > git tree: https://github.com/google/kasan.git usb-fuzzer > console output: https://syzkaller.appspot.com/x/log.txt?x=13c2

Re: KASAN: out-of-bounds Read in hidraw_ioctl

2019-08-13 Thread Andrey Konovalov
On Fri, Aug 9, 2019 at 8:18 PM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:e96407b4 usb-fuzzer: main usb gadget fuzzer driver > git tree: https://github.com/google/kasan.git usb-fuzzer > console output: https://syzkaller.appspot.com/x/log.txt?x=12612

Re: [EXT] INFO: trying to register non-static key in del_timer_sync (2)

2019-08-13 Thread Kalle Valo
Andrey Konovalov writes: > On Wed, Jun 12, 2019 at 6:03 PM Ganapathi Bhat wrote: >> >> Hi Dmitry, >> >> We have a patch to fix this: https://patchwork.kernel.org/patch/10990275/ > > Hi Ganapathi, > > Has this patch been accepted anywhere? This bug is still open on syzbot. The patch is in "Chang

Re: KASAN: use-after-free Read in device_release_driver_internal

2019-08-13 Thread Andrey Konovalov
On Wed, Aug 7, 2019 at 3:44 PM Andrey Konovalov wrote: > > On Wed, Aug 7, 2019 at 3:44 PM Andrey Konovalov wrote: > > > > On Wed, Aug 7, 2019 at 3:38 PM Oliver Neukum wrote: > > > > > > Am Dienstag, den 06.08.2019, 14:50 +0200 schrieb Andrey Konovalov: > > > > On Tue, Aug 6, 2019 at 2:36 PM Oliv

Re: KASAN: use-after-free Read in v4l2_ioctl

2019-08-13 Thread Andrey Konovalov
On Tue, Aug 13, 2019 at 2:28 PM Andrey Konovalov wrote: > > On Sun, Apr 14, 2019 at 10:06 PM syzbot > wrote: > > > > Hello, > > > > syzbot found the following crash on: > > > > HEAD commit:9a33b369 usb-fuzzer: main usb gadget fuzzer driver > > git tree: https://github.com/google/kasan/t

Re: [PATCH v2 10/10] RFC: usb-storage: export symbols in USB_STORAGE namespace

2019-08-13 Thread Matthias Maennich
On Tue, Aug 13, 2019 at 02:47:08PM +0200, Greg KH wrote: On Tue, Aug 13, 2019 at 01:17:07PM +0100, Matthias Maennich wrote: Modules using these symbols are required to explicitly import the namespace. This patch was generated with the following steps and serves as a reference to use the symbol n

Re: KMSAN: uninit-value in smsc75xx_bind

2019-08-13 Thread Andrey Konovalov
On Tue, Aug 13, 2019 at 2:43 PM Oliver Neukum wrote: > > Am Freitag, den 09.08.2019, 01:48 -0700 schrieb syzbot: > > Hello, > > > > syzbot found the following crash on: > > > > HEAD commit:beaab8a3 fix KASAN build > > git tree: kmsan > > [..] > > Call Trace: > > __dump_stack lib/dump_s

Re: KASAN: use-after-free Read in device_release_driver_internal

2019-08-13 Thread Greg KH
On Tue, Aug 13, 2019 at 03:22:15PM +0200, Oliver Neukum wrote: > Am Dienstag, den 13.08.2019, 14:42 +0200 schrieb Andrey Konovalov: > > > > > > [..] > > > On Thu, Aug 8, 2019 at 4:00 PM Alan Stern wrote: > > > Ah, that looks right, thank you. The patch worked correctly -- good > > > work Oliv

Re: [PATCH v2 03/10] module: add support for symbol namespaces.

2019-08-13 Thread Greg KH
On Tue, Aug 13, 2019 at 01:17:00PM +0100, Matthias Maennich wrote: > The EXPORT_SYMBOL_NS() and EXPORT_SYMBOL_NS_GPL() macros can be used to > export a symbol to a specific namespace. There are no _GPL_FUTURE and > _UNUSED variants because these are currently unused, and I'm not sure > they are ne

Re: [PATCH v2 04/10] modpost: add support for symbol namespaces

2019-08-13 Thread Greg KH
On Tue, Aug 13, 2019 at 01:17:01PM +0100, Matthias Maennich wrote: > Add support for symbols that are exported into namespaces. For that, > extract any namespace suffix from the symbol name. In addition, emit a > warning whenever a module refers to an exported symbol without > explicitly importing

Re: [PATCH v2 06/10] export: allow definition default namespaces in Makefiles or sources

2019-08-13 Thread Greg KH
On Tue, Aug 13, 2019 at 01:17:03PM +0100, Matthias Maennich wrote: > To avoid excessive usage of EXPORT_SYMBOL_NS(sym, MY_NAMESPACE), where > MY_NAMESPACE will always be the namespace we are exporting to, allow > exporting all definitions of EXPORT_SYMBOL() and friends by defining > DEFAULT_SYMBOL_

Re: [PATCH v2 06/10] export: allow definition default namespaces in Makefiles or sources

2019-08-13 Thread Greg KH
On Tue, Aug 13, 2019 at 01:17:03PM +0100, Matthias Maennich wrote: > To avoid excessive usage of EXPORT_SYMBOL_NS(sym, MY_NAMESPACE), where > MY_NAMESPACE will always be the namespace we are exporting to, allow > exporting all definitions of EXPORT_SYMBOL() and friends by defining > DEFAULT_SYMBOL_

Re: [PATCH v2 05/10] module: add config option MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS

2019-08-13 Thread Greg KH
On Tue, Aug 13, 2019 at 01:17:02PM +0100, Matthias Maennich wrote: > If MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is enabled (default=n), the > requirement for modules to import all namespaces that are used by > the module is relaxed. > > Enabling this option effectively allows (invalid) modules to b

Re: [PATCH v2 07/10] modpost: add support for generating namespace dependencies

2019-08-13 Thread Greg KH
On Tue, Aug 13, 2019 at 01:17:04PM +0100, Matthias Maennich wrote: > This patch adds an option to modpost to generate a .ns_deps file > per module, containing the namespace dependencies for that module. > > E.g. if the linked module my-module.ko would depend on the symbol > myfunc.MY_NS in the nam

Re: [PATCH v5 1/2] usbip: Skip DMA mapping and unmapping for urb at vhci

2019-08-13 Thread shuah
On 8/8/19 10:18 AM, shuah wrote: On 8/8/19 9:54 AM, Suwan Kim wrote: vhci doesn’t do DMA for remote device. Actually, the real DMA operation is done by network card driver. vhci just passes virtual address of the buffer to the network stack, so vhci doesn’t use and need dma address of the buffer

Re: [PATCH v5 2/2] usbip: Implement SG support to vhci-hcd and stub driver

2019-08-13 Thread shuah
On 8/8/19 10:21 AM, shuah wrote: On 8/8/19 9:54 AM, Suwan Kim wrote: There are bugs on vhci with usb 3.0 storage device. In USB, each SG list entry buffer should be divisible by the bulk max packet size. But with native SG support, this problem doesn't matter because the SG buffer is treated as

Re: [PATCH] media: em28xx: modules workqueue not inited for 2nd device

2019-08-13 Thread Brad Love
Hey Sean, On 13/08/2019 04.10, Sean Young wrote: > Hi Brad, > > On Mon, Aug 12, 2019 at 10:21:39AM -0300, Ezequiel Garcia wrote: >> On Sun, 2019-08-11 at 06:11 +0100, Sean Young wrote: >>> syzbot reports an error on flush_request_modules() for the second device. >>> This workqueue was never initi

Re: Slow I/O on USB media after commit f664a3cc17b7d0a2bc3b3ab96181e1029b0ec0e6

2019-08-13 Thread Alan Stern
On Fri, 9 Aug 2019, Andrea Vai wrote: > Il giorno lun, 08/07/2019 alle 11.38 -0400, Alan Stern ha scritto: > > > > [...] > > Andrea, another thing you could try is to collect a usbmon trace > > under > > > > one of the "slow" kernels. Follow the instructions in > > > > Documentation/usb/usbmo

Re: WARNING in usbhid_raw_request/usb_submit_urb

2019-08-13 Thread Alan Stern
On Mon, 12 Aug 2019, syzbot wrote: > Hello, > > syzbot has tested the proposed patch but the reproducer still triggered > crash: > KASAN: invalid-free in hcd_buffer_free This bug report shows that Hillf's fix isn't exactly right. > usb 5-1: USB disconnect, device number 2 > ==

[PATCH] USB: usbfs: Add a capability flag for runtime suspend

2019-08-13 Thread Alan Stern
The recent commit 7794f486ed0b ("usbfs: Add ioctls for runtime power management") neglected to add a corresponding capability flag. This patch rectifies the omission. Signed-off-by: Alan Stern CC: Mayuresh Kulkarni --- [as1908] drivers/usb/core/devio.c |9 - include/ua

Re: [PATCH v2 05/10] module: add config option MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS

2019-08-13 Thread Saravana Kannan
On Tue, Aug 13, 2019 at 5:19 AM 'Matthias Maennich' via kernel-team wrote: > > If MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is enabled (default=n), the > requirement for modules to import all namespaces that are used by > the module is relaxed. > > Enabling this option effectively allows (invalid) mo

Re: [PATCH] media: em28xx: modules workqueue not inited for 2nd device

2019-08-13 Thread Sean Young
Hi Brad, On Tue, Aug 13, 2019 at 01:48:34PM -0500, Brad Love wrote: > > On Mon, Aug 12, 2019 at 10:21:39AM -0300, Ezequiel Garcia wrote: > >> On Sun, 2019-08-11 at 06:11 +0100, Sean Young wrote: > >>> syzbot reports an error on flush_request_modules() for the second device. > >>> This workqueue wa

Re: KASAN: global-out-of-bounds Read in dvb_pll_attach

2019-08-13 Thread Sean Young
On Tue, Aug 13, 2019 at 03:22:49PM +0200, Andrey Konovalov wrote: > On Wed, Jul 17, 2019 at 2:29 PM syzbot > wrote: > > > > Hello, > > > > syzbot has tested the proposed patch and the reproducer did not trigger > > crash: > > > > Reported-and-tested-by: > > syzbot+8a8f48672560c8ca5...@syzkaller.ap

  1   2   >