kernel BUG at drivers/usb/wusbcore/wusbhc.c:LINE!

30 views
Skip to first unread message

syzbot

unread,
Jul 23, 2019, 8:48:10 AM7/23/19
to andre...@google.com, gre...@linuxfoundation.org, j...@perches.com, linux-...@vger.kernel.org, linu...@vger.kernel.org, lo...@kragniz.eu, syzkall...@googlegroups.com
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=1417be94600000
kernel config: https://syzkaller.appspot.com/x/.config?x=700ca426ab83faae
dashboard link: https://syzkaller.appspot.com/bug?extid=fd2bd7df88c606eea4ef
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15d5d25c600000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15c29358600000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+fd2bd7...@syzkaller.appspotmail.com

usb 1-1: BUG? WUSB host has no security descriptors
hwa-hc 1-1:0.66: Wireless USB HWA host controller
hwa-hc 1-1:0.66: new USB bus registered, assigned bus number 11
hwa-hc 1-1:0.66: Cannot set WUSB Cluster ID to 0xfe: -71
hwa-hc 1-1:0.66: Wireless USB Cluster ID set to 0xfe
------------[ cut here ]------------
kernel BUG at drivers/usb/wusbcore/wusbhc.c:385!
invalid opcode: 0000 [#1] SMP KASAN
CPU: 1 PID: 21 Comm: kworker/1:1 Not tainted 5.2.0-rc6+ #15
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Workqueue: usb_hub_wq hub_event
RIP: 0010:wusb_cluster_id_put+0x6b/0x80 /drivers/usb/wusbcore/wusbhc.c:385
Code: 7b 9d ce fd 40 84 ed 74 23 e8 41 9c ce fd f0 48 0f b3 1d e8 d6 0e 06
5b 48 c7 c7 60 1b 06 87 5d e9 8a 3c e9 01 e8 25 9c ce fd <0f> 0b e8 1e 9c
ce fd 0f 0b eb d4 66 2e 0f 1f 84 00 00 00 00 00 41
RSP: 0018:ffff8881d9eff0e8 EFLAGS: 00010293
RAX: ffff8881d9e36000 RBX: 00000000ffffffff RCX: ffffffff836e3f37
RDX: 0000000000000000 RSI: ffffffff836e3f8b RDI: 0000000000000001
RBP: 00000000000000fe R08: ffff8881d9e36000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 00000000ffffffb9
R13: ffff8881d4a52600 R14: ffff8881d0b5d530 R15: 00000000000000fe
FS: 0000000000000000(0000) GS:ffff8881db300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007efcea69e000 CR3: 00000001d4f3a000 CR4: 00000000001406e0
Call Trace:
hwahc_op_start.cold+0x159/0x183 /drivers/usb/host/hwa-hc.c:162
usb_add_hcd.cold+0xaac/0x15a1 /drivers/usb/core/hcd.c:2887
hwahc_probe.cold+0xef/0x48b /drivers/usb/host/hwa-hc.c:810
usb_probe_interface+0x305/0x7a0 /drivers/usb/core/driver.c:361
really_probe+0x281/0x660 /drivers/base/dd.c:509
driver_probe_device+0x104/0x210 /drivers/base/dd.c:670
__device_attach_driver+0x1c2/0x220 /drivers/base/dd.c:777
bus_for_each_drv+0x15c/0x1e0 /drivers/base/bus.c:454
__device_attach+0x217/0x360 /drivers/base/dd.c:843
bus_probe_device+0x1e4/0x290 /drivers/base/bus.c:514
device_add+0xae6/0x16f0 /drivers/base/core.c:2111
usb_set_configuration+0xdf6/0x1670 /drivers/usb/core/message.c:2023
generic_probe+0x9d/0xd5 /drivers/usb/core/generic.c:210
usb_probe_device+0x99/0x100 /drivers/usb/core/driver.c:266
really_probe+0x281/0x660 /drivers/base/dd.c:509
driver_probe_device+0x104/0x210 /drivers/base/dd.c:670
__device_attach_driver+0x1c2/0x220 /drivers/base/dd.c:777
bus_for_each_drv+0x15c/0x1e0 /drivers/base/bus.c:454
__device_attach+0x217/0x360 /drivers/base/dd.c:843
bus_probe_device+0x1e4/0x290 /drivers/base/bus.c:514
device_add+0xae6/0x16f0 /drivers/base/core.c:2111
usb_new_device.cold+0x6a4/0xe61 /drivers/usb/core/hub.c:2536
hub_port_connect /drivers/usb/core/hub.c:5098 [inline]
hub_port_connect_change /drivers/usb/core/hub.c:5213 [inline]
port_event /drivers/usb/core/hub.c:5359 [inline]
hub_event+0x1abd/0x3550 /drivers/usb/core/hub.c:5441
process_one_work+0x905/0x1570 /kernel/workqueue.c:2269
worker_thread+0x96/0xe20 /kernel/workqueue.c:2415
kthread+0x30b/0x410 /kernel/kthread.c:255
ret_from_fork+0x24/0x30 /arch/x86/entry/entry_64.S:352
Modules linked in:
---[ end trace 328f1b9a8fbb35b6 ]---
RIP: 0010:wusb_cluster_id_put+0x6b/0x80 /drivers/usb/wusbcore/wusbhc.c:385
Code: 7b 9d ce fd 40 84 ed 74 23 e8 41 9c ce fd f0 48 0f b3 1d e8 d6 0e 06
5b 48 c7 c7 60 1b 06 87 5d e9 8a 3c e9 01 e8 25 9c ce fd <0f> 0b e8 1e 9c
ce fd 0f 0b eb d4 66 2e 0f 1f 84 00 00 00 00 00 41
RSP: 0018:ffff8881d9eff0e8 EFLAGS: 00010293
RAX: ffff8881d9e36000 RBX: 00000000ffffffff RCX: ffffffff836e3f37
RDX: 0000000000000000 RSI: ffffffff836e3f8b RDI: 0000000000000001
RBP: 00000000000000fe R08: ffff8881d9e36000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 00000000ffffffb9
R13: ffff8881d4a52600 R14: ffff8881d0b5d530 R15: 00000000000000fe
FS: 0000000000000000(0000) GS:ffff8881db300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007efcea69e000 CR3: 00000001d4f3a000 CR4: 00000000001406e0


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Jul 23, 2019, 2:24:02 PM7/23/19
to syzkall...@googlegroups.com, tranma...@gmail.com
Hello,

syzbot tried to test the proposed patch but build/boot failed:

022571][ T0] kvm-clock: cpu 1, msr 83ee041, secondary cpu clock
[ 2.353315][ T1] MDS CPU bug present and SMT on, data leak possible.
See https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/mds.html for
more details.
[ 2.354887][ T1] smp: Brought up 1 node, 2 CPUs
[ 2.355551][ T1] smpboot: Max logical packages: 1
[ 2.356308][ T1] smpboot: Total of 2 processors activated (9199.99
BogoMIPS)
[ 2.358460][ T1] devtmpfs: initialized
[ 2.373843][ T1] clocksource: jiffies: mask: 0xffffffff max_cycles:
0xffffffff, max_idle_ns: 19112604462750000 ns
[ 2.375416][ T1] futex hash table entries: 512 (order: 4, 65536
bytes, linear)
[ 2.377436][ T1] PM: RTC time: 18:12:07, date: 2019-07-23
[ 2.379188][ T1] NET: Registered protocol family 16
[ 2.383033][ T1] audit: initializing netlink subsys (disabled)
[ 2.383997][ T21] audit: type=2000 audit(1563905527.572:1):
state=initialized audit_enabled=0 res=1
[ 2.384250][ T1] cpuidle: using governor menu
[ 2.384799][ T1] ACPI: bus type PCI registered
[ 2.386123][ T1] PCI: Using configuration type 1 for base access
[ 2.492527][ T1] HugeTLB registered 2.00 MiB page size, pre-allocated
0 pages
[ 2.493542][ T27] cryptomgr_test (27) used greatest stack depth: 30208
bytes left
[ 2.493542][ T29] kworker/u4:0 (29) used greatest stack depth: 27608
bytes left
[ 2.512781][ T1] ACPI: Added _OSI(Module Device)
[ 2.513553][ T1] ACPI: Added _OSI(Processor Device)
[ 2.514265][ T1] ACPI: Added _OSI(3.0 _SCP Extensions)
[ 2.515102][ T1] ACPI: Added _OSI(Processor Aggregator Device)
[ 2.515971][ T1] ACPI: Added _OSI(Linux-Dell-Video)
[ 2.516824][ T1] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
[ 2.522022][ T1] ACPI: Added _OSI(Linux-HPI-Hybrid-Graphics)
[ 2.572963][ T1] ACPI: 2 ACPI AML tables successfully acquired and
loaded
[ 2.587082][ T1] ACPI: Interpreter enabled
[ 2.588040][ T1] ACPI: (supports S0 S3 S4 S5)
[ 2.588727][ T1] ACPI: Using IOAPIC for interrupt routing
[ 2.589674][ T1] PCI: Using host bridge windows from ACPI; if
necessary, use "pci=nocrs" and report a bug
[ 2.593677][ T1] ACPI: Enabled 16 GPEs in block 00 to 0F
[ 2.670151][ T1] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus
00-ff])
[ 2.671279][ T1] acpi PNP0A03:00: _OSC: OS supports [ASPM ClockPM
Segments MSI HPX-Type3]
[ 2.672408][ T1] acpi PNP0A03:00: fail to add MMCONFIG information,
can't access extended PCI configuration space under this bridge.
[ 2.679525][ T1] PCI host bridge to bus 0000:00
[ 2.680372][ T1] pci_bus 0000:00: root bus resource [io
0x0000-0x0cf7 window]
[ 2.682032][ T1] pci_bus 0000:00: root bus resource [io
0x0d00-0xffff window]
[ 2.683201][ T1] pci_bus 0000:00: root bus resource [mem
0x000a0000-0x000bffff window]
[ 2.684337][ T1] pci_bus 0000:00: root bus resource [mem
0xc0000000-0xfebfffff window]
[ 2.685532][ T1] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 2.687071][ T1] pci 0000:00:00.0: [8086:1237] type 00 class 0x060000
[ 2.693457][ T1] pci 0000:00:01.0: [8086:7110] type 00 class 0x060100
[ 2.709159][ T1] pci 0000:00:01.3: [8086:7113] type 00 class 0x068000
[ 2.723956][ T1] pci 0000:00:01.3: quirk: [io 0xb000-0xb03f] claimed
by PIIX4 ACPI
[ 2.727638][ T1] pci 0000:00:03.0: [1af4:1004] type 00 class 0x000000
[ 2.733779][ T1] pci 0000:00:03.0: reg 0x10: [io 0xc000-0xc03f]
[ 2.738045][ T1] pci 0000:00:03.0: reg 0x14: [mem
0xfebfe000-0xfebfe07f]
[ 2.751597][ T1] pci 0000:00:04.0: [1af4:1000] type 00 class 0x020000
[ 2.756622][ T1] pci 0000:00:04.0: reg 0x10: [io 0xc040-0xc07f]
[ 2.762027][ T1] pci 0000:00:04.0: reg 0x14: [mem
0xfebff000-0xfebff07f]
[ 2.786261][ T1] ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *10 11)
[ 2.789943][ T1] ACPI: PCI Interrupt Link [LNKB] (IRQs 5 *10 11)
[ 2.793535][ T1] ACPI: PCI Interrupt Link [LNKC] (IRQs 5 10 *11)
[ 2.797095][ T1] ACPI: PCI Interrupt Link [LNKD] (IRQs 5 10 *11)
[ 2.799837][ T1] ACPI: PCI Interrupt Link [LNKS] (IRQs *9)
[ 2.806543][ T1] vgaarb: loaded
[ 2.806543][ T1] SCSI subsystem initialized
[ 2.806543][ T1] ACPI: bus type USB registered
[ 2.806543][ T1] usbcore: registered new interface driver usbfs
[ 2.812173][ T1] usbcore: registered new interface driver hub
[ 2.813401][ T1] usbcore: registered new device driver usb
[ 2.814837][ T1] mc: Linux media interface: v0.10
[ 2.815703][ T1] videodev: Linux video capture interface: v2.00
[ 2.816934][ T1] pps_core: LinuxPPS API ver. 1 registered
[ 2.817839][ T1] pps_core: Software ver. 5.3.6 - Copyright 2005-2007
Rodolfo Giometti <giom...@linux.it>
[ 2.819280][ T1] PTP clock support registered
[ 2.822243][ T1] EDAC MC: Ver: 3.0.0
[ 2.823394][ T1] Advanced Linux Sound Architecture Driver Initialized.
[ 2.823986][ T1] PCI: Using ACPI for IRQ routing
[ 2.827351][ T1] Bluetooth: Core ver 2.22
[ 2.828160][ T1] NET: Registered protocol family 31
[ 2.828877][ T1] Bluetooth: HCI device and connection manager
initialized
[ 2.830006][ T1] Bluetooth: HCI socket layer initialized
[ 2.830835][ T1] Bluetooth: L2CAP socket layer initialized
[ 2.832037][ T1] Bluetooth: SCO socket layer initialized
[ 2.832880][ T1] NET: Registered protocol family 8
[ 2.833584][ T1] NET: Registered protocol family 20
[ 2.834475][ T1] NetLabel: Initializing
[ 2.835096][ T1] NetLabel: domain hash size = 128
[ 2.835791][ T1] NetLabel: protocols = UNLABELED CIPSOv4 CALIPSO
[ 2.836916][ T1] NetLabel: unlabeled traffic allowed by default
[ 2.838008][ T1] nfc: nfc_init: NFC Core ver 0.1
[ 2.838008][ T1] NET: Registered protocol family 39
[ 2.842488][ T1] clocksource: Switched to clocksource kvm-clock
[ 3.819262][ T1] VFS: Disk quotas dquot_6.6.0
[ 3.820200][ T1] VFS: Dquot-cache hash table entries: 512 (order 0,
4096 bytes)
[ 3.821641][ T1] *** VALIDATE hugetlbfs ***
[ 3.822916][ T1] pnp: PnP ACPI init
[ 3.833670][ T1] pnp: PnP ACPI: found 7 devices
[ 3.855464][ T1] thermal_sys: Registered thermal governor 'step_wise'
[ 3.855468][ T1] thermal_sys: Registered thermal governor 'user_space'
[ 3.861236][ T1] clocksource: acpi_pm: mask: 0xffffff max_cycles:
0xffffff, max_idle_ns: 2085701024 ns
[ 3.863862][ T1] pci_bus 0000:00: resource 4 [io 0x0000-0x0cf7
window]
[ 3.864893][ T1] pci_bus 0000:00: resource 5 [io 0x0d00-0xffff
window]
[ 3.865896][ T1] pci_bus 0000:00: resource 6 [mem
0x000a0000-0x000bffff window]
[ 3.866995][ T1] pci_bus 0000:00: resource 7 [mem
0xc0000000-0xfebfffff window]
[ 3.868896][ T1] NET: Registered protocol family 2
[ 3.870920][ T1] tcp_listen_portaddr_hash hash table entries: 4096
(order: 6, 294912 bytes, linear)
[ 3.872552][ T1] TCP established hash table entries: 65536 (order: 7,
524288 bytes, linear)
[ 3.874401][ T1] TCP bind hash table entries: 65536 (order: 10,
4194304 bytes, linear)
[ 3.879563][ T1] TCP: Hash tables configured (established 65536 bind
65536)
[ 3.881629][ T1] UDP hash table entries: 4096 (order: 7, 655360
bytes, linear)
[ 3.883198][ T1] UDP-Lite hash table entries: 4096 (order: 7, 655360
bytes, linear)
[ 3.885656][ T1] NET: Registered protocol family 1
[ 3.887922][ T1] RPC: Registered named UNIX socket transport module.
[ 3.888978][ T1] RPC: Registered udp transport module.
[ 3.889814][ T1] RPC: Registered tcp transport module.
[ 3.890794][ T1] RPC: Registered tcp NFSv4.1 backchannel transport
module.
[ 3.892886][ T1] pci 0000:00:00.0: Limiting direct PCI/PCI transfers
[ 3.893918][ T1] PCI: CLS 0 bytes, default 64
[ 3.895161][ T1] PCI-DMA: Using software bounce buffering for IO
(SWIOTLB)
[ 3.896218][ T1] software IO TLB: mapped [mem 0xbbffd000-0xbfffd000]
(64MB)
[ 3.899482][ T1] RAPL PMU: API unit is 2^-32 Joules, 0 fixed
counters, 10737418240 ms ovfl timer
[ 3.900793][ T1] clocksource: tsc: mask: 0xffffffffffffffff
max_cycles: 0x212733415c7, max_idle_ns: 440795236380 ns
[ 3.902381][ T1] clocksource: Switched to clocksource tsc
[ 3.905633][ T1] check: Scanning for low memory corruption every 60
seconds
[ 3.910013][ T1] Initialise system trusted keyrings
[ 3.911137][ T1] workingset: timestamp_bits=40 max_order=21
bucket_order=0
[ 3.949780][ T1] NFS: Registering the id_resolver key type
[ 3.950861][ T1] Key type id_resolver registered
[ 3.951798][ T1] Key type id_legacy registered
[ 3.953319][ T1] 9p: Installing v9fs 9p2000 file system support
[ 3.959887][ T1] Key type asymmetric registered
[ 3.960684][ T1] Asymmetric key parser 'x509' registered
[ 3.961856][ T1] Block layer SCSI generic (bsg) driver version 0.4
loaded (major 247)
[ 3.963170][ T1] io scheduler mq-deadline registered
[ 3.964034][ T1] io scheduler kyber registered
[ 3.967097][ T1] usbcore: registered new interface driver udlfb
[ 3.968247][ T1] usbcore: registered new interface driver smscufx
[ 3.970111][ T1] input: Power Button as
/devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
[ 3.971495][ T1] ACPI: Power Button [PWRF]
[ 3.972691][ T1] input: Sleep Button as
/devices/LNXSYSTM:00/LNXSLPBN:00/input/input1
[ 3.973975][ T1] ACPI: Sleep Button [SLPF]
[ 3.987344][ T1] PCI Interrupt Link [LNKC] enabled at IRQ 11
[ 3.988327][ T1] virtio-pci 0000:00:03.0: virtio_pci: leaving for
legacy driver
[ 4.000554][ T1] PCI Interrupt Link [LNKD] enabled at IRQ 10
[ 4.001490][ T1] virtio-pci 0000:00:04.0: virtio_pci: leaving for
legacy driver
[ 4.006154][ T1] Serial: 8250/16550 driver, 4 ports, IRQ sharing
enabled
[ 4.029197][ T1] 00:03: ttyS0 at I/O 0x3f8 (irq = 4, base_baud =
115200) is a 16550A
[ 4.053156][ T1] 00:04: ttyS1 at I/O 0x2f8 (irq = 3, base_baud =
115200) is a 16550A
[ 4.077145][ T1] 00:05: ttyS2 at I/O 0x3e8 (irq = 6, base_baud =
115200) is a 16550A
[ 4.101374][ T1] 00:06: ttyS3 at I/O 0x2e8 (irq = 7, base_baud =
115200) is a 16550A
[ 4.105273][ T1] Non-volatile memory driver v1.3
[ 4.106636][ T1] Linux agpgart interface v0.103
[ 4.112344][ T1] usbcore: registered new interface driver udl
[ 4.133078][ T1] loop: module loaded
[ 4.138016][ T1] usbcore: registered new interface driver rtsx_usb
[ 4.139480][ T1] usbcore: registered new interface driver viperboard
[ 4.141047][ T1] usbcore: registered new interface driver dln2
[ 4.142684][ T1] usbcore: registered new interface driver pn533_usb
[ 4.144047][ T1] usbcore: registered new interface driver port100
[ 4.145377][ T1] usbcore: registered new interface driver nfcmrvl
[ 4.158094][ T1] scsi host0: Virtio SCSI HBA
[ 4.198216][ T1] kasan: CONFIG_KASAN_INLINE enabled
[ 4.200066][ T1] kasan: GPF could be caused by NULL-ptr deref or user
memory access
[ 4.202761][ T1] general protection fault: 0000 [#1] SMP KASAN
[ 4.204812][ T1] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.3.0-rc1+
#1
[ 4.206992][ T1] Hardware name: Google Google Compute Engine/Google
Compute Engine, BIOS Google 01/01/2011
[ 4.210452][ T1] RIP: 0010:dma_direct_max_mapping_size+0x73/0x19a
[ 4.212421][ T1] Code: df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 1e
01 00 00 48 8b 9d 38 03 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 da 48 c1
ea 03 <80> 3c 02 00 0f 85 06 01 00 00 48 8d bd 48 03 00 00 48 8b 1b 48 b8
[ 4.212722][ T1] RSP: 0000:ffff8881da18f628 EFLAGS: 00010246
[ 4.212722][ T1] RAX: dffffc0000000000 RBX: 0000000000000000 RCX:
ffffffff812d716c
[ 4.212722][ T1] RDX: 0000000000000000 RSI: ffffffff812d7189 RDI:
ffff8881d829fa78
[ 4.212722][ T1] RBP: ffff8881d829f740 R08: ffff8881da180000 R09:
ffffed103ad1a0cb
[ 4.212722][ T1] R10: ffffed103ad1a0ca R11: ffff8881d68d0657 R12:
ffff8881d829f740
[ 4.212722][ T1] R13: ffff8881d769d7b0 R14: 0000000000000200 R15:
0000000000000000
[ 4.212722][ T1] FS: 0000000000000000(0000)
GS:ffff8881db300000(0000) knlGS:0000000000000000
[ 4.212722][ T1] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 4.212722][ T1] CR2: 0000000000000000 CR3: 0000000006a21000 CR4:
00000000001406e0
[ 4.212722][ T1] Call Trace:
[ 4.212722][ T1] dma_max_mapping_size+0xb5/0xf0
[ 4.212722][ T1] __scsi_init_queue+0x17e/0x510
[ 4.212722][ T1] scsi_mq_alloc_queue+0xcb/0x170
[ 4.212722][ T1] scsi_alloc_sdev+0x82e/0xc50
[ 4.212722][ T1] scsi_probe_and_add_lun+0x1ee5/0x2cd0
[ 4.212722][ T1] ? find_held_lock+0x2d/0x110
[ 4.212722][ T1] ? __pm_runtime_resume+0x111/0x180
[ 4.212722][ T1] ? scsi_alloc_sdev+0xc50/0xc50
[ 4.212722][ T1] ? mark_held_locks+0x9f/0xe0
[ 4.212722][ T1] ? _raw_spin_unlock_irqrestore+0x3e/0x50
[ 4.212722][ T1] ? lockdep_hardirqs_on+0x379/0x580
[ 4.212722][ T1] __scsi_scan_target+0x273/0xc30
[ 4.212722][ T1] ? find_held_lock+0x2d/0x110
[ 4.212722][ T1] ? __pm_runtime_resume+0x111/0x180
[ 4.212722][ T1] ? scsi_probe_and_add_lun+0x2cd0/0x2cd0
[ 4.212722][ T1] ? mark_lock+0xbc/0x1130
[ 4.212722][ T1] scsi_scan_channel.part.0+0x126/0x1a0
[ 4.212722][ T1] scsi_scan_host_selected+0x2bb/0x3f0
[ 4.212722][ T1] do_scsi_scan_host+0x1e8/0x260
[ 4.212722][ T1] scsi_scan_host+0x37c/0x440
[ 4.212722][ T1] virtscsi_probe+0x9b7/0xbb5
[ 4.212722][ T1] ? virtscsi_restore+0x240/0x240
[ 4.212722][ T1] virtio_dev_probe+0x463/0x710
[ 4.212722][ T1] ? virtio_device_restore+0x1f0/0x1f0
[ 4.212722][ T1] really_probe+0x281/0x650
[ 4.212722][ T1] driver_probe_device+0x101/0x1b0
[ 4.212722][ T1] device_driver_attach+0x108/0x140
[ 4.212722][ T1] __driver_attach+0xda/0x240
[ 4.212722][ T1] ? device_driver_attach+0x140/0x140
[ 4.212722][ T1] bus_for_each_dev+0x14b/0x1d0
[ 4.212722][ T1] ? subsys_dev_iter_exit+0x20/0x20
[ 4.212722][ T1] bus_add_driver+0x44e/0x5a0
[ 4.212722][ T1] driver_register+0x1c4/0x320
[ 4.212722][ T1] ? spi_transport_init+0x132/0x132
[ 4.212722][ T1] init+0xa1/0x115
[ 4.212722][ T1] do_one_initcall+0xf0/0x614
[ 4.212722][ T1] ? perf_trace_initcall_level+0x3e0/0x3e0
[ 4.212722][ T1] ? parameq+0x110/0x160
[ 4.212722][ T1] kernel_init_freeable+0x4a9/0x596
[ 4.212722][ T1] ? rest_init+0x371/0x371
[ 4.212722][ T1] kernel_init+0xd/0x1bf
[ 4.212722][ T1] ret_from_fork+0x24/0x30
[ 4.212722][ T1] Modules linked in:
[ 4.308290][ T1] ---[ end trace 247acb7f5b43d7d5 ]---
[ 4.309994][ T1] RIP: 0010:dma_direct_max_mapping_size+0x73/0x19a
[ 4.312168][ T1] Code: df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 1e
01 00 00 48 8b 9d 38 03 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 da 48 c1
ea 03 <80> 3c 02 00 0f 85 06 01 00 00 48 8d bd 48 03 00 00 48 8b 1b 48 b8
[ 4.318340][ T1] RSP: 0000:ffff8881da18f628 EFLAGS: 00010246
[ 4.320143][ T1] RAX: dffffc0000000000 RBX: 0000000000000000 RCX:
ffffffff812d716c
[ 4.322831][ T1] RDX: 0000000000000000 RSI: ffffffff812d7189 RDI:
ffff8881d829fa78
[ 4.325468][ T1] RBP: ffff8881d829f740 R08: ffff8881da180000 R09:
ffffed103ad1a0cb
[ 4.327936][ T1] R10: ffffed103ad1a0ca R11: ffff8881d68d0657 R12:
ffff8881d829f740
[ 4.330211][ T1] R13: ffff8881d769d7b0 R14: 0000000000000200 R15:
0000000000000000
[ 4.332848][ T1] FS: 0000000000000000(0000)
GS:ffff8881db300000(0000) knlGS:0000000000000000
[ 4.335744][ T1] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 4.337850][ T1] CR2: 0000000000000000 CR3: 0000000006a21000 CR4:
00000000001406e0
[ 4.340337][ T1] Kernel panic - not syncing: Fatal exception
[ 4.342644][ T1] Kernel Offset: disabled
[ 4.342775][ T1] Rebooting in 86400 seconds..


Error text is too large and was truncated, full error text is at:
https://syzkaller.appspot.com/x/error.txt?x=152e40cc600000


Tested on:

commit: 1154c0b0 wip
kernel config: https://syzkaller.appspot.com/x/.config?x=b228fb19779df17d
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
patch: https://syzkaller.appspot.com/x/patch.diff?x=1777774c600000

Andrey Konovalov

unread,
Jul 23, 2019, 2:41:23 PM7/23/19
to syzbot, syzkaller-bugs, tranma...@gmail.com
USB fuzzing is currently broken due to a boot bug in 5.3-rc1, could
you try testing on the usb-fuzzer-usb-testing-2019.07.11 branch as a
workaround? Thanks!
> --
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bug...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/000000000000f3be6c058e5d4b98%40google.com.

syzbot

unread,
Jul 23, 2019, 9:38:01 PM7/23/19
to syzkall...@googlegroups.com, tranma...@gmail.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger
crash:

Reported-and-tested-by:
syzbot+fd2bd7...@syzkaller.appspotmail.com

Tested on:

commit: 6a3599ce usb-fuzzer: main usb gadget fuzzer driver
git tree: https://github.com/google/kasan.git
usb-fuzzer-usb-testing-2019.07.11
kernel config: https://syzkaller.appspot.com/x/.config?x=700ca426ab83faae
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
patch: https://syzkaller.appspot.com/x/patch.diff?x=122c2e94600000

Note: testing is done by a robot and is best-effort only.

Phong Tran

unread,
Jul 23, 2019, 10:06:20 PM7/23/19
to syzbot+fd2bd7...@syzkaller.appspotmail.com, andre...@google.com, gre...@linuxfoundation.org, j...@perches.com, linux-...@vger.kernel.org, linu...@vger.kernel.org, lo...@kragniz.eu, syzkall...@googlegroups.com, benq...@gmail.com, linux-kern...@lists.linuxfoundation.org, Phong Tran
syzboot reported that
https://syzkaller.appspot.com/bug?extid=fd2bd7df88c606eea4ef

There is not consitency parameter in cluste_id_get/put calling.
In case of getting the id with result is failure, the wusbhc->cluster_id
will not be updated and this can not be used for wusb_cluster_id_put().

Tested report
https://groups.google.com/d/msg/syzkaller-bugs/0znZopp3-9k/oxOrhLkLEgAJ

Reported-by: syzbot+fd2bd7...@syzkaller.appspotmail.com

Reproduce and gdb got the details:

139 addr = wusb_cluster_id_get();
(gdb) n
140 if (addr == 0)
(gdb) print addr
$1 = 254 '\376'
(gdb) n
142 result = __hwahc_set_cluster_id(hwahc, addr);
(gdb) print result
$2 = -71
(gdb) break wusb_cluster_id_put
Breakpoint 3 at 0xffffffff836e3f20: file drivers/usb/wusbcore/wusbhc.c, line 384.
(gdb) s
Thread 2 hit Breakpoint 3, wusb_cluster_id_put (id=0 '\000') at drivers/usb/wusbcore/wusbhc.c:384
384 id = 0xff - id;
(gdb) n
385 BUG_ON(id >= CLUSTER_IDS);
(gdb) print id
$3 = 255 '\377'

Signed-off-by: Phong Tran <tranma...@gmail.com>
---
drivers/usb/host/hwa-hc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/hwa-hc.c b/drivers/usb/host/hwa-hc.c
index 09a8ebd95588..6968b9f2b76b 100644
--- a/drivers/usb/host/hwa-hc.c
+++ b/drivers/usb/host/hwa-hc.c
@@ -159,7 +159,7 @@ static int hwahc_op_start(struct usb_hcd *usb_hcd)
return result;

error_set_cluster_id:
- wusb_cluster_id_put(wusbhc->cluster_id);
+ wusb_cluster_id_put(addr);
error_cluster_id_get:
goto out;

--
2.20.1

Reply all
Reply to author
Forward
0 new messages