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

2019-08-13 Thread Himanshu Jha
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 next v9 07/11] usb: roles: Add fwnode_usb_role_switch_get() function

2019-08-13 Thread Chunfeng Yun
On Tue, 2019-08-13 at 16:01 +0300, Heikki Krogerus wrote: > 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

RE: [PATCH V2 1/2] usb: dwc3: Add node to update cache type setting

2019-08-13 Thread Ran Wang
Hi Felipe On Friday, July 26, 2019 11:30 Ran Wang wrote: > > Hi Felipe, > > On Friday, July 26, 2019 05:56, Rob Herring wrote: > > > > On Wed, Jul 24, 2019 at 8:29 PM Ran Wang wrote: > > > > > > Hi Rob, > > > > > > On Thursday, July 25, 2019 04:42 Rob Herring wrote: > > > > > > > > On Fri, Ju

[PATCH AUTOSEL 5.2 073/123] net: usb: pegasus: fix improper read if get_registers() fail

2019-08-13 Thread Sasha Levin
From: Denis Kirjanov [ Upstream commit 224c04973db1125fcebefffd86115f99f50f8277 ] get_registers() may fail with -ENOMEM and in this case we can read a garbage from the status variable tmp. Reported-by: syzbot+3499a83b2d062ae40...@syzkaller.appspotmail.com Signed-off-by: Denis Kirjanov Signed-o

[PATCH AUTOSEL 4.19 36/68] net: usb: pegasus: fix improper read if get_registers() fail

2019-08-13 Thread Sasha Levin
From: Denis Kirjanov [ Upstream commit 224c04973db1125fcebefffd86115f99f50f8277 ] get_registers() may fail with -ENOMEM and in this case we can read a garbage from the status variable tmp. Reported-by: syzbot+3499a83b2d062ae40...@syzkaller.appspotmail.com Signed-off-by: Denis Kirjanov Signed-o

[PATCH AUTOSEL 4.19 48/68] HID: hiddev: avoid opening a disconnected device

2019-08-13 Thread Sasha Levin
From: Hillf Danton [ Upstream commit 9c09b214f30e3c11f9b0b03f89442df03643794d ] 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/

[PATCH AUTOSEL 4.4 10/28] net: usb: qmi_wwan: Add the BroadMobi BM818 card

2019-08-13 Thread Sasha Levin
From: Bob Ham [ Upstream commit 9a07406b00cdc6ec689dc142540739575c717f3c ] The BroadMobi BM818 M.2 card uses the QMI protocol Signed-off-by: Bob Ham Signed-off-by: Angus Ainslie (Purism) Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/qmi_wwan.c | 1 + 1 file

[PATCH AUTOSEL 4.4 20/28] HID: hiddev: avoid opening a disconnected device

2019-08-13 Thread Sasha Levin
From: Hillf Danton [ Upstream commit 9c09b214f30e3c11f9b0b03f89442df03643794d ] 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/

[PATCH AUTOSEL 4.4 21/28] HID: hiddev: do cleanup in failure of opening a device

2019-08-13 Thread Sasha Levin
From: Hillf Danton [ Upstream commit 6d4472d7bec39917b54e4e80245784ea5d60ce49 ] Undo what we did for opening before releasing the memory slice. Reported-by: syzbot Cc: Andrey Konovalov Signed-off-by: Hillf Danton Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/usbhid

[PATCH AUTOSEL 4.4 15/28] net: usb: pegasus: fix improper read if get_registers() fail

2019-08-13 Thread Sasha Levin
From: Denis Kirjanov [ Upstream commit 224c04973db1125fcebefffd86115f99f50f8277 ] get_registers() may fail with -ENOMEM and in this case we can read a garbage from the status variable tmp. Reported-by: syzbot+3499a83b2d062ae40...@syzkaller.appspotmail.com Signed-off-by: Denis Kirjanov Signed-o

[PATCH AUTOSEL 4.9 16/33] net: usb: pegasus: fix improper read if get_registers() fail

2019-08-13 Thread Sasha Levin
From: Denis Kirjanov [ Upstream commit 224c04973db1125fcebefffd86115f99f50f8277 ] get_registers() may fail with -ENOMEM and in this case we can read a garbage from the status variable tmp. Reported-by: syzbot+3499a83b2d062ae40...@syzkaller.appspotmail.com Signed-off-by: Denis Kirjanov Signed-o

[PATCH AUTOSEL 4.9 23/33] HID: hiddev: do cleanup in failure of opening a device

2019-08-13 Thread Sasha Levin
From: Hillf Danton [ Upstream commit 6d4472d7bec39917b54e4e80245784ea5d60ce49 ] Undo what we did for opening before releasing the memory slice. Reported-by: syzbot Cc: Andrey Konovalov Signed-off-by: Hillf Danton Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/usbhid

[PATCH AUTOSEL 4.9 22/33] HID: hiddev: avoid opening a disconnected device

2019-08-13 Thread Sasha Levin
From: Hillf Danton [ Upstream commit 9c09b214f30e3c11f9b0b03f89442df03643794d ] 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/

[PATCH AUTOSEL 4.9 11/33] net: usb: qmi_wwan: Add the BroadMobi BM818 card

2019-08-13 Thread Sasha Levin
From: Bob Ham [ Upstream commit 9a07406b00cdc6ec689dc142540739575c717f3c ] The BroadMobi BM818 M.2 card uses the QMI protocol Signed-off-by: Bob Ham Signed-off-by: Angus Ainslie (Purism) Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/qmi_wwan.c | 1 + 1 file

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

2019-08-13 Thread Chunfeng Yun
On Tue, 2019-08-13 at 13:52 +0300, 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() be

[PATCH AUTOSEL 4.19 49/68] HID: hiddev: do cleanup in failure of opening a device

2019-08-13 Thread Sasha Levin
From: Hillf Danton [ Upstream commit 6d4472d7bec39917b54e4e80245784ea5d60ce49 ] Undo what we did for opening before releasing the memory slice. Reported-by: syzbot Cc: Andrey Konovalov Signed-off-by: Hillf Danton Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/usbhid

[PATCH AUTOSEL 4.14 30/44] HID: hiddev: avoid opening a disconnected device

2019-08-13 Thread Sasha Levin
From: Hillf Danton [ Upstream commit 9c09b214f30e3c11f9b0b03f89442df03643794d ] 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/

[PATCH AUTOSEL 4.14 22/44] net: usb: pegasus: fix improper read if get_registers() fail

2019-08-13 Thread Sasha Levin
From: Denis Kirjanov [ Upstream commit 224c04973db1125fcebefffd86115f99f50f8277 ] get_registers() may fail with -ENOMEM and in this case we can read a garbage from the status variable tmp. Reported-by: syzbot+3499a83b2d062ae40...@syzkaller.appspotmail.com Signed-off-by: Denis Kirjanov Signed-o

[PATCH AUTOSEL 4.14 31/44] HID: hiddev: do cleanup in failure of opening a device

2019-08-13 Thread Sasha Levin
From: Hillf Danton [ Upstream commit 6d4472d7bec39917b54e4e80245784ea5d60ce49 ] Undo what we did for opening before releasing the memory slice. Reported-by: syzbot Cc: Andrey Konovalov Signed-off-by: Hillf Danton Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/usbhid

[PATCH AUTOSEL 4.14 13/44] net: usb: qmi_wwan: Add the BroadMobi BM818 card

2019-08-13 Thread Sasha Levin
From: Bob Ham [ Upstream commit 9a07406b00cdc6ec689dc142540739575c717f3c ] The BroadMobi BM818 M.2 card uses the QMI protocol Signed-off-by: Bob Ham Signed-off-by: Angus Ainslie (Purism) Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/qmi_wwan.c | 1 + 1 file

[PATCH AUTOSEL 4.19 21/68] net: usb: qmi_wwan: Add the BroadMobi BM818 card

2019-08-13 Thread Sasha Levin
From: Bob Ham [ Upstream commit 9a07406b00cdc6ec689dc142540739575c717f3c ] The BroadMobi BM818 M.2 card uses the QMI protocol Signed-off-by: Bob Ham Signed-off-by: Angus Ainslie (Purism) Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/qmi_wwan.c | 1 + 1 file

[PATCH AUTOSEL 5.2 092/123] HID: hiddev: avoid opening a disconnected device

2019-08-13 Thread Sasha Levin
From: Hillf Danton [ Upstream commit 9c09b214f30e3c11f9b0b03f89442df03643794d ] 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/

[PATCH AUTOSEL 5.2 093/123] HID: hiddev: do cleanup in failure of opening a device

2019-08-13 Thread Sasha Levin
From: Hillf Danton [ Upstream commit 6d4472d7bec39917b54e4e80245784ea5d60ce49 ] Undo what we did for opening before releasing the memory slice. Reported-by: syzbot Cc: Andrey Konovalov Signed-off-by: Hillf Danton Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/usbhid

[PATCH AUTOSEL 5.2 049/123] net: usb: qmi_wwan: Add the BroadMobi BM818 card

2019-08-13 Thread Sasha Levin
From: Bob Ham [ Upstream commit 9a07406b00cdc6ec689dc142540739575c717f3c ] The BroadMobi BM818 M.2 card uses the QMI protocol Signed-off-by: Bob Ham Signed-off-by: Angus Ainslie (Purism) Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/qmi_wwan.c | 1 + 1 file

Re: [PATCH net-next v2 0/5] r8152: RX improve

2019-08-13 Thread Jakub Kicinski
On Tue, 13 Aug 2019 11:42:04 +0800, Hayes Wang wrote: > v2: > For patch #2, replace list_for_each_safe with list_for_each_entry_safe. > Remove unlikely in WARN_ON. Adjust the coding style. > > For patch #4, replace list_for_each_safe with list_for_each_entry_safe. > Remove "else" after "continue".

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

2019-08-13 Thread Justin Piszcz
On Tue, Aug 13, 2019 at 6:48 AM Damien Le Moal wrote: > > 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 avo

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

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: [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

[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: 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 > ==

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: [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: [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 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 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 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 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 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 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: 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: 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: [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: 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: 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: [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: 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: 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: [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: [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: 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: 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: 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: [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: 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: 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: 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: 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: [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: 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: 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: [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: 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: 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: [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: 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: 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 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: 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 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: [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: [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: 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 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: 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 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: [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] 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] 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 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: 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: 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

[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

[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 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 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 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 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

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 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 --

[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 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 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

  1   2   >