syzbot


possible deadlock in dummy_timer

Status: closed as invalid on 2020/02/04 12:57
Subsystems: usb
[Documentation on labels]
First crash: 1590d, last: 1589d

Sample crash report:
========================================================
WARNING: possible irq lock inversion dependency detected
5.5.0-rc2-syzkaller #0 Not tainted
--------------------------------------------------------
kworker/1:7/4170 just changed the state of lock:
ffff8881d4e00018 (&(&dum_hcd->dum->lock)->rlock){+.-.}, at: spin_lock include/linux/spinlock.h:338 [inline]
ffff8881d4e00018 (&(&dum_hcd->dum->lock)->rlock){+.-.}, at: dummy_timer+0x1245/0x2fdb drivers/usb/gadget/udc/dummy_hcd.c:1967
but this lock was taken by another, HARDIRQ-safe lock in the past:
 (&(&dev->event_lock)->rlock){-.-.}


and interrupts could create inverse lock ordering between them.


other info that might help us debug this:
Chain exists of:
  &(&dev->event_lock)->rlock --> &(&xpad->odata_lock)->rlock --> &(&dum_hcd->dum->lock)->rlock

 Possible interrupt unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&(&dum_hcd->dum->lock)->rlock);
                               local_irq_disable();
                               lock(&(&dev->event_lock)->rlock);
                               lock(&(&xpad->odata_lock)->rlock);
  <Interrupt>
    lock(&(&dev->event_lock)->rlock);

 *** DEADLOCK ***

7 locks held by kworker/1:7/4170:
 #0: ffff8881d8841d28 ((wq_completion)usb_hub_wq){+.+.}, at: __write_once_size include/linux/compiler.h:226 [inline]
 #0: ffff8881d8841d28 ((wq_completion)usb_hub_wq){+.+.}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: ffff8881d8841d28 ((wq_completion)usb_hub_wq){+.+.}, at: atomic64_set include/asm-generic/atomic-instrumented.h:855 [inline]
 #0: ffff8881d8841d28 ((wq_completion)usb_hub_wq){+.+.}, at: atomic_long_set include/asm-generic/atomic-long.h:40 [inline]
 #0: ffff8881d8841d28 ((wq_completion)usb_hub_wq){+.+.}, at: set_work_data kernel/workqueue.c:615 [inline]
 #0: ffff8881d8841d28 ((wq_completion)usb_hub_wq){+.+.}, at: set_work_pool_and_clear_pending kernel/workqueue.c:642 [inline]
 #0: ffff8881d8841d28 ((wq_completion)usb_hub_wq){+.+.}, at: process_one_work+0x827/0x1530 kernel/workqueue.c:2235
 #1: ffff8881c7377dd0 ((work_completion)(&hub->events)){+.+.}, at: process_one_work+0x85b/0x1530 kernel/workqueue.c:2239
 #2: ffff8881d4e73200 (&dev->mutex){....}, at: device_lock include/linux/device.h:1493 [inline]
 #2: ffff8881d4e73200 (&dev->mutex){....}, at: hub_event+0x1b2/0x3860 drivers/usb/core/hub.c:5498
 #3: ffff8881d4e75540 (&port_dev->status_lock){+.+.}, at: usb_lock_port drivers/usb/core/hub.c:2997 [inline]
 #3: ffff8881d4e75540 (&port_dev->status_lock){+.+.}, at: hub_port_connect drivers/usb/core/hub.c:5115 [inline]
 #3: ffff8881d4e75540 (&port_dev->status_lock){+.+.}, at: hub_port_connect_change drivers/usb/core/hub.c:5324 [inline]
 #3: ffff8881d4e75540 (&port_dev->status_lock){+.+.}, at: port_event drivers/usb/core/hub.c:5470 [inline]
 #3: ffff8881d4e75540 (&port_dev->status_lock){+.+.}, at: hub_event+0x1c67/0x3860 drivers/usb/core/hub.c:5552
 #4: ffff8881d4d6d460 (hcd->address0_mutex){+.+.}, at: hub_port_init+0x1b6/0x2d30 drivers/usb/core/hub.c:4539
 #5: ffffffff86ef58c0 (console_lock){+.+.}, at: console_trylock_spinning kernel/printk/printk.c:1751 [inline]
 #5: ffffffff86ef58c0 (console_lock){+.+.}, at: vprintk_emit+0x2f7/0x3d0 kernel/printk/printk.c:1995
 #6: ffff8881db309d70 ((&dum_hcd->timer)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:172 [inline]
 #6: ffff8881db309d70 ((&dum_hcd->timer)){+.-.}, at: call_timer_fn+0xcd/0x650 kernel/time/timer.c:1394

the shortest dependencies between 2nd lock and 1st lock:
  -> (&(&dev->event_lock)->rlock){-.-.} {
     IN-HARDIRQ-W at:
                        lock_acquire+0x127/0x320 kernel/locking/lockdep.c:4485
                        __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                        _raw_spin_lock_irqsave+0x32/0x50 kernel/locking/spinlock.c:159
                        input_event drivers/input/input.c:439 [inline]
                        input_event+0x7b/0xb0 drivers/input/input.c:432
                        input_report_key include/linux/input.h:417 [inline]
                        psmouse_report_standard_buttons+0x2c/0x80 drivers/input/mouse/psmouse-base.c:123
                        psmouse_report_standard_packet drivers/input/mouse/psmouse-base.c:141 [inline]
                        psmouse_process_byte+0x1e1/0x890 drivers/input/mouse/psmouse-base.c:232
                        psmouse_handle_byte+0x41/0x1b0 drivers/input/mouse/psmouse-base.c:274
                        psmouse_interrupt+0x2f7/0xe90 drivers/input/mouse/psmouse-base.c:426
                        serio_interrupt+0x88/0x150 drivers/input/serio/serio.c:1002
                        i8042_interrupt+0x266/0x500 drivers/input/serio/i8042.c:596
                        __handle_irq_event_percpu+0xee/0x7d0 kernel/irq/handle.c:149
                        handle_irq_event_percpu+0x76/0x160 kernel/irq/handle.c:189
                        handle_irq_event+0xa2/0x12d kernel/irq/handle.c:206
                        handle_edge_irq+0x233/0x8a0 kernel/irq/chip.c:830
                        generic_handle_irq_desc include/linux/irqdesc.h:156 [inline]
                        do_IRQ+0x99/0x210 arch/x86/kernel/irq.c:250
                        ret_from_intr+0x0/0x31
                        __read_once_size include/linux/compiler.h:199 [inline]
                        check_kcov_mode kernel/kcov.c:166 [inline]
                        __sanitizer_cov_trace_pc+0x2b/0x60 kernel/kcov.c:198
                        usb_match_id.part.0+0x3e/0x120 drivers/usb/core/driver.c:783
                        usb_match_id drivers/usb/core/driver.c:775 [inline]
                        usb_device_match drivers/usb/core/driver.c:817 [inline]
                        usb_device_match+0xe5/0x190 drivers/usb/core/driver.c:793
                        driver_match_device drivers/base/base.h:129 [inline]
                        __driver_attach+0x6c/0x240 drivers/base/dd.c:1041
                        bus_for_each_dev+0x14b/0x1d0 drivers/base/bus.c:304
                        bus_add_driver+0x457/0x5a0 drivers/base/bus.c:621
                        driver_register+0x1c4/0x330 drivers/base/driver.c:170
                        usb_register_driver+0x244/0x460 drivers/usb/core/driver.c:962
                        do_one_initcall+0xf0/0x620 init/main.c:939
                        do_initcall_level init/main.c:1007 [inline]
                        do_initcalls init/main.c:1015 [inline]
                        do_basic_setup init/main.c:1032 [inline]
                        kernel_init_freeable+0x4a4/0x548 init/main.c:1216
                        kernel_init+0xd/0x1b9 init/main.c:1110
                        ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352
     IN-SOFTIRQ-W at:
                        lock_acquire+0x127/0x320 kernel/locking/lockdep.c:4485
                        __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                        _raw_spin_lock_irqsave+0x32/0x50 kernel/locking/spinlock.c:159
                        input_event drivers/input/input.c:439 [inline]
                        input_event+0x7b/0xb0 drivers/input/input.c:432
                        hidinput_hid_event+0x1236/0x15d3 drivers/hid/hid-input.c:1382
                        hid_process_event+0x4a0/0x580 drivers/hid/hid-core.c:1506
                        hid_input_field drivers/hid/hid-core.c:1550 [inline]
                        hid_report_raw_event+0xabb/0xed0 drivers/hid/hid-core.c:1757
                        hid_input_report+0x315/0x3f0 drivers/hid/hid-core.c:1824
                        hid_irq_in+0x50e/0x690 drivers/hid/usbhid/hid-core.c:284
                        __usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650
                        usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716
                        dummy_timer+0x123d/0x2fdb drivers/usb/gadget/udc/dummy_hcd.c:1966
                        call_timer_fn+0x179/0x650 kernel/time/timer.c:1404
                        expire_timers kernel/time/timer.c:1449 [inline]
                        __run_timers kernel/time/timer.c:1773 [inline]
                        __run_timers kernel/time/timer.c:1740 [inline]
                        run_timer_softirq+0x5e3/0x1490 kernel/time/timer.c:1786
                        __do_softirq+0x221/0x912 kernel/softirq.c:292
                        invoke_softirq kernel/softirq.c:373 [inline]
                        irq_exit+0x178/0x1a0 kernel/softirq.c:413
                        exiting_irq arch/x86/include/asm/apic.h:536 [inline]
                        smp_apic_timer_interrupt+0x12f/0x500 arch/x86/kernel/apic/apic.c:1137
                        apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
                        native_restore_fl arch/x86/include/asm/irqflags.h:41 [inline]
                        arch_local_irq_restore arch/x86/include/asm/irqflags.h:84 [inline]
                        seqcount_lockdep_reader_access include/linux/seqlock.h:83 [inline]
                        read_seqcount_begin include/linux/seqlock.h:164 [inline]
                        ktime_get_ts64+0x25d/0x2b0 kernel/time/timekeeping.c:890
                        posix_ktime_get_ts+0x11/0x20 kernel/time/posix-timers.c:192
                        __do_sys_clock_gettime kernel/time/posix-timers.c:1070 [inline]
                        __se_sys_clock_gettime kernel/time/posix-timers.c:1060 [inline]
                        __x64_sys_clock_gettime+0x149/0x240 kernel/time/posix-timers.c:1060
                        do_syscall_64+0xb6/0x5c0 arch/x86/entry/common.c:294
                        entry_SYSCALL_64_after_hwframe+0x49/0xbe
     INITIAL USE at:
                       lock_acquire+0x127/0x320 kernel/locking/lockdep.c:4485
                       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                       _raw_spin_lock_irqsave+0x32/0x50 kernel/locking/spinlock.c:159
                       input_inject_event+0xa6/0x31e drivers/input/input.c:465
                       __led_set_brightness drivers/leds/led-core.c:46 [inline]
                       led_set_brightness_nopm+0x48/0xf0 drivers/leds/led-core.c:273
                       led_set_brightness_nosleep drivers/leds/led-core.c:290 [inline]
                       led_set_brightness drivers/leds/led-core.c:265 [inline]
                       led_set_brightness+0x11c/0x240 drivers/leds/led-core.c:241
                       led_trigger_event drivers/leds/led-triggers.c:373 [inline]
                       led_trigger_event+0x70/0xd0 drivers/leds/led-triggers.c:363
                       kbd_led_trigger_activate+0xf5/0x130 drivers/tty/vt/keyboard.c:998
                       led_trigger_set+0x61a/0xbd0 drivers/leds/led-triggers.c:185
                       led_trigger_set_default drivers/leds/led-triggers.c:248 [inline]
                       led_trigger_set_default+0x135/0x1a0 drivers/leds/led-triggers.c:236
                       led_classdev_register_ext+0x4e1/0x670 drivers/leds/led-class.c:316
                       led_classdev_register include/linux/leds.h:181 [inline]
                       input_leds_connect+0x3df/0x6af drivers/input/input-leds.c:139
                       input_attach_handler+0x194/0x200 drivers/input/input.c:1024
                       input_register_device.cold+0xf5/0x246 drivers/input/input.c:2224
                       atkbd_connect+0x63b/0x800 drivers/input/keyboard/atkbd.c:1198
                       serio_connect_driver+0x46/0x70 drivers/input/serio/serio.c:47
                       really_probe+0x281/0x6d0 drivers/base/dd.c:548
                       driver_probe_device+0x104/0x210 drivers/base/dd.c:721
                       device_driver_attach+0x108/0x140 drivers/base/dd.c:995
                       __driver_attach+0xda/0x240 drivers/base/dd.c:1072
                       bus_for_each_dev+0x14b/0x1d0 drivers/base/bus.c:304
                       serio_attach_driver drivers/input/serio/serio.c:808 [inline]
                       serio_handle_event+0x54a/0x850 drivers/input/serio/serio.c:227
                       process_one_work+0x92b/0x1530 kernel/workqueue.c:2264
                       worker_thread+0x96/0xe20 kernel/workqueue.c:2410
                       kthread+0x318/0x420 kernel/kthread.c:255
                       ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352
   }
   ... key      at: [<ffffffff89c8c620>] __key.35515+0x0/0x40
   ... acquired at:
   __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
   _raw_spin_lock_irqsave+0x32/0x50 kernel/locking/spinlock.c:159
   xpad_play_effect+0xfe/0xc50 drivers/input/joystick/xpad.c:1225
   ml_play_effects+0x817/0x1270 drivers/input/ff-memless.c:398
   ml_ff_playback+0x285/0x3d0 drivers/input/ff-memless.c:460
   input_ff_event+0x13a/0x2e0 drivers/input/ff-core.c:286
   input_handle_event+0x732/0x13a0 drivers/input/input.c:375
   input_inject_event+0x305/0x31e drivers/input/input.c:470
   evdev_write+0x2c9/0x410 drivers/input/evdev.c:542
   __vfs_write+0x76/0x100 fs/read_write.c:494
   vfs_write+0x262/0x5c0 fs/read_write.c:558
   ksys_write+0x1e8/0x250 fs/read_write.c:611
   do_syscall_64+0xb6/0x5c0 arch/x86/entry/common.c:294
   entry_SYSCALL_64_after_hwframe+0x49/0xbe

 -> (&(&xpad->odata_lock)->rlock){..-.} {
    IN-SOFTIRQ-W at:
                      lock_acquire+0x127/0x320 kernel/locking/lockdep.c:4485
                      __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                      _raw_spin_lock_irqsave+0x32/0x50 kernel/locking/spinlock.c:159
                      xpad_irq_out+0x9e/0x2b0 drivers/input/joystick/xpad.c:1036
                      __usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650
                      usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716
                      dummy_timer+0x123d/0x2fdb drivers/usb/gadget/udc/dummy_hcd.c:1966
                      call_timer_fn+0x179/0x650 kernel/time/timer.c:1404
                      expire_timers kernel/time/timer.c:1449 [inline]
                      __run_timers kernel/time/timer.c:1773 [inline]
                      __run_timers kernel/time/timer.c:1740 [inline]
                      run_timer_softirq+0x5e3/0x1490 kernel/time/timer.c:1786
                      __do_softirq+0x221/0x912 kernel/softirq.c:292
                      invoke_softirq kernel/softirq.c:373 [inline]
                      irq_exit+0x178/0x1a0 kernel/softirq.c:413
                      exiting_irq arch/x86/include/asm/apic.h:536 [inline]
                      smp_apic_timer_interrupt+0x12f/0x500 arch/x86/kernel/apic/apic.c:1137
                      apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
                      debug_spin_unlock kernel/locking/spinlock_debug.c:102 [inline]
                      do_raw_spin_unlock+0x107/0x220 kernel/locking/spinlock_debug.c:138
                      __raw_spin_unlock include/linux/spinlock_api_smp.h:151 [inline]
                      _raw_spin_unlock+0x1a/0x30 kernel/locking/spinlock.c:183
                      spin_unlock include/linux/spinlock.h:378 [inline]
                      browse_rb mm/mmap.c:366 [inline]
                      validate_mm+0x371/0x610 mm/mmap.c:426
                      remove_vma_list mm/mmap.c:2585 [inline]
                      __do_munmap+0x5de/0x11c0 mm/mmap.c:2826
                      __vm_munmap+0xe6/0x170 mm/mmap.c:2846
                      __do_sys_munmap mm/mmap.c:2872 [inline]
                      __se_sys_munmap mm/mmap.c:2868 [inline]
                      __x64_sys_munmap+0x62/0x80 mm/mmap.c:2868
                      do_syscall_64+0xb6/0x5c0 arch/x86/entry/common.c:294
                      entry_SYSCALL_64_after_hwframe+0x49/0xbe
    INITIAL USE at:
                     lock_acquire+0x127/0x320 kernel/locking/lockdep.c:4485
                     __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                     _raw_spin_lock_irqsave+0x32/0x50 kernel/locking/spinlock.c:159
                     xpad_send_led_command drivers/input/joystick/xpad.c:1356 [inline]
                     xpad_led_set+0x59/0x5a0 drivers/input/joystick/xpad.c:1405
                     __led_set_brightness drivers/leds/led-core.c:46 [inline]
                     led_set_brightness_nopm+0x48/0xf0 drivers/leds/led-core.c:273
                     led_set_brightness_nosleep drivers/leds/led-core.c:290 [inline]
                     led_set_brightness drivers/leds/led-core.c:265 [inline]
                     led_set_brightness+0x11c/0x240 drivers/leds/led-core.c:241
                     xpad_identify_controller drivers/input/joystick/xpad.c:1396 [inline]
                     xpad_led_probe drivers/input/joystick/xpad.c:1439 [inline]
                     xpad_init_input+0xdc0/0x1160 drivers/input/joystick/xpad.c:1681
                     xpad_probe+0x1129/0x1b20 drivers/input/joystick/xpad.c:1827
                     usb_probe_interface+0x305/0x7a0 drivers/usb/core/driver.c:361
                     really_probe+0x281/0x6d0 drivers/base/dd.c:548
                     driver_probe_device+0x104/0x210 drivers/base/dd.c:721
                     __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:828
                     bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:430
                     __device_attach+0x217/0x360 drivers/base/dd.c:894
                     bus_probe_device+0x1e4/0x290 drivers/base/bus.c:490
                     device_add+0x1480/0x1c20 drivers/base/core.c:2487
                     usb_set_configuration+0xe67/0x1740 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/0x6d0 drivers/base/dd.c:548
                     driver_probe_device+0x104/0x210 drivers/base/dd.c:721
                     __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:828
                     bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:430
                     __device_attach+0x217/0x360 drivers/base/dd.c:894
                     bus_probe_device+0x1e4/0x290 drivers/base/bus.c:490
                     device_add+0x1480/0x1c20 drivers/base/core.c:2487
                     usb_new_device.cold+0x6a4/0xe79 drivers/usb/core/hub.c:2537
                     hub_port_connect drivers/usb/core/hub.c:5184 [inline]
                     hub_port_connect_change drivers/usb/core/hub.c:5324 [inline]
                     port_event drivers/usb/core/hub.c:5470 [inline]
                     hub_event+0x1e59/0x3860 drivers/usb/core/hub.c:5552
                     process_one_work+0x92b/0x1530 kernel/workqueue.c:2264
                     process_scheduled_works kernel/workqueue.c:2326 [inline]
                     worker_thread+0x7ab/0xe20 kernel/workqueue.c:2412
                     kthread+0x318/0x420 kernel/kthread.c:255
                     ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352
  }
  ... key      at: [<ffffffff89c8d320>] __key.33357+0x0/0x40
  ... acquired at:
   __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
   _raw_spin_lock_irqsave+0x32/0x50 kernel/locking/spinlock.c:159
   dummy_urb_enqueue+0x109/0x890 drivers/usb/gadget/udc/dummy_hcd.c:1257
   usb_hcd_submit_urb+0x2aa/0x1ee0 drivers/usb/core/hcd.c:1547
   usb_submit_urb+0x6e5/0x13b0 drivers/usb/core/urb.c:570
   xpad_try_sending_next_out_packet drivers/input/joystick/xpad.c:1013 [inline]
   xpad_try_sending_next_out_packet+0xf3/0x170 drivers/input/joystick/xpad.c:1007
   xpad_send_led_command drivers/input/joystick/xpad.c:1385 [inline]
   xpad_led_set+0x3b1/0x5a0 drivers/input/joystick/xpad.c:1405
   __led_set_brightness drivers/leds/led-core.c:46 [inline]
   led_set_brightness_nopm+0x48/0xf0 drivers/leds/led-core.c:273
   led_set_brightness_nosleep drivers/leds/led-core.c:290 [inline]
   led_set_brightness drivers/leds/led-core.c:265 [inline]
   led_set_brightness+0x11c/0x240 drivers/leds/led-core.c:241
   xpad_identify_controller drivers/input/joystick/xpad.c:1396 [inline]
   xpad_led_probe drivers/input/joystick/xpad.c:1439 [inline]
   xpad_init_input+0xdc0/0x1160 drivers/input/joystick/xpad.c:1681
   xpad_probe+0x1129/0x1b20 drivers/input/joystick/xpad.c:1827
   usb_probe_interface+0x305/0x7a0 drivers/usb/core/driver.c:361
   really_probe+0x281/0x6d0 drivers/base/dd.c:548
   driver_probe_device+0x104/0x210 drivers/base/dd.c:721
   __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:828
   bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:430
   __device_attach+0x217/0x360 drivers/base/dd.c:894
   bus_probe_device+0x1e4/0x290 drivers/base/bus.c:490
   device_add+0x1480/0x1c20 drivers/base/core.c:2487
   usb_set_configuration+0xe67/0x1740 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/0x6d0 drivers/base/dd.c:548
   driver_probe_device+0x104/0x210 drivers/base/dd.c:721
   __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:828
   bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:430
   __device_attach+0x217/0x360 drivers/base/dd.c:894
   bus_probe_device+0x1e4/0x290 drivers/base/bus.c:490
   device_add+0x1480/0x1c20 drivers/base/core.c:2487
   usb_new_device.cold+0x6a4/0xe79 drivers/usb/core/hub.c:2537
   hub_port_connect drivers/usb/core/hub.c:5184 [inline]
   hub_port_connect_change drivers/usb/core/hub.c:5324 [inline]
   port_event drivers/usb/core/hub.c:5470 [inline]
   hub_event+0x1e59/0x3860 drivers/usb/core/hub.c:5552
   process_one_work+0x92b/0x1530 kernel/workqueue.c:2264
   process_scheduled_works kernel/workqueue.c:2326 [inline]
   worker_thread+0x7ab/0xe20 kernel/workqueue.c:2412
   kthread+0x318/0x420 kernel/kthread.c:255
   ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

-> (&(&dum_hcd->dum->lock)->rlock){+.-.} {
   HARDIRQ-ON-W at:
                    lock_acquire+0x127/0x320 kernel/locking/lockdep.c:4485
                    __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
                    _raw_spin_lock+0x27/0x40 kernel/locking/spinlock.c:151
                    spin_lock include/linux/spinlock.h:338 [inline]
                    dummy_timer+0x1245/0x2fdb drivers/usb/gadget/udc/dummy_hcd.c:1967
                    call_timer_fn+0x179/0x650 kernel/time/timer.c:1404
                    expire_timers kernel/time/timer.c:1449 [inline]
                    __run_timers kernel/time/timer.c:1773 [inline]
                    __run_timers kernel/time/timer.c:1740 [inline]
                    run_timer_softirq+0x5e3/0x1490 kernel/time/timer.c:1786
                    __do_softirq+0x221/0x912 kernel/softirq.c:292
                    invoke_softirq kernel/softirq.c:373 [inline]
                    irq_exit+0x178/0x1a0 kernel/softirq.c:413
                    exiting_irq arch/x86/include/asm/apic.h:536 [inline]
                    smp_apic_timer_interrupt+0x12f/0x500 arch/x86/kernel/apic/apic.c:1137
                    apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
                    native_restore_fl arch/x86/include/asm/irqflags.h:41 [inline]
                    arch_local_irq_restore arch/x86/include/asm/irqflags.h:84 [inline]
                    console_unlock+0xa1b/0xc30 kernel/printk/printk.c:2481
                    vprintk_emit+0x171/0x3d0 kernel/printk/printk.c:1996
                    dev_vprintk_emit+0x4fc/0x541 drivers/base/core.c:3603
                    dev_printk_emit+0xba/0xf1 drivers/base/core.c:3614
                    __dev_printk+0x1db/0x203 drivers/base/core.c:3626
                    _dev_info+0xd7/0x109 drivers/base/core.c:3672
                    hub_port_init.cold+0x2e6/0x35b drivers/usb/core/hub.c:4604
                    hub_port_connect drivers/usb/core/hub.c:5116 [inline]
                    hub_port_connect_change drivers/usb/core/hub.c:5324 [inline]
                    port_event drivers/usb/core/hub.c:5470 [inline]
                    hub_event+0x1c7c/0x3860 drivers/usb/core/hub.c:5552
                    process_one_work+0x92b/0x1530 kernel/workqueue.c:2264
                    worker_thread+0x96/0xe20 kernel/workqueue.c:2410
                    kthread+0x318/0x420 kernel/kthread.c:255
                    ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352
   IN-SOFTIRQ-W at:
                    lock_acquire+0x127/0x320 kernel/locking/lockdep.c:4485
                    __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                    _raw_spin_lock_irqsave+0x32/0x50 kernel/locking/spinlock.c:159
                    dummy_hub_status+0x47/0x330 drivers/usb/gadget/udc/dummy_hcd.c:2000
                    usb_hcd_poll_rh_status+0x125/0x600 drivers/usb/core/hcd.c:765
                    call_timer_fn+0x179/0x650 kernel/time/timer.c:1404
                    expire_timers kernel/time/timer.c:1449 [inline]
                    __run_timers kernel/time/timer.c:1773 [inline]
                    __run_timers kernel/time/timer.c:1740 [inline]
                    run_timer_softirq+0x5e3/0x1490 kernel/time/timer.c:1786
                    __do_softirq+0x221/0x912 kernel/softirq.c:292
                    invoke_softirq kernel/softirq.c:373 [inline]
                    irq_exit+0x178/0x1a0 kernel/softirq.c:413
                    exiting_irq arch/x86/include/asm/apic.h:536 [inline]
                    smp_apic_timer_interrupt+0x12f/0x500 arch/x86/kernel/apic/apic.c:1137
                    apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
                    native_restore_fl arch/x86/include/asm/irqflags.h:41 [inline]
                    arch_local_irq_restore arch/x86/include/asm/irqflags.h:84 [inline]
                    lock_release+0x3c5/0x6b0 kernel/locking/lockdep.c:4506
                    __raw_spin_unlock include/linux/spinlock_api_smp.h:150 [inline]
                    _raw_spin_unlock+0x12/0x30 kernel/locking/spinlock.c:183
                    spin_unlock include/linux/spinlock.h:378 [inline]
                    do_anonymous_page mm/memory.c:3144 [inline]
                    handle_pte_fault mm/memory.c:3943 [inline]
                    __handle_mm_fault+0x16c9/0x2da0 mm/memory.c:4075
                    handle_mm_fault+0x2ec/0x8d0 mm/memory.c:4112
                    do_user_addr_fault arch/x86/mm/fault.c:1441 [inline]
                    __do_page_fault+0x617/0xca0 arch/x86/mm/fault.c:1506
                    page_fault+0x34/0x40 arch/x86/entry/entry_64.S:1203
   INITIAL USE at:
                   lock_acquire+0x127/0x320 kernel/locking/lockdep.c:4485
                   __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                   _raw_spin_lock_irqsave+0x32/0x50 kernel/locking/spinlock.c:159
                   dummy_hub_control+0xa3/0x13f0 drivers/usb/gadget/udc/dummy_hcd.c:2088
                   rh_call_control drivers/usb/core/hcd.c:683 [inline]
                   rh_urb_enqueue drivers/usb/core/hcd.c:842 [inline]
                   usb_hcd_submit_urb+0xe6d/0x1ee0 drivers/usb/core/hcd.c:1543
                   usb_submit_urb+0x6e5/0x13b0 drivers/usb/core/urb.c:570
                   usb_start_wait_urb+0x108/0x2b0 drivers/usb/core/message.c:57
                   usb_internal_control_msg drivers/usb/core/message.c:101 [inline]
                   usb_control_msg+0x31c/0x4a0 drivers/usb/core/message.c:152
                   get_hub_descriptor drivers/usb/core/hub.c:387 [inline]
                   hub_configure drivers/usb/core/hub.c:1393 [inline]
                   hub_probe.cold+0xbb8/0x2204 drivers/usb/core/hub.c:1865
                   usb_probe_interface+0x305/0x7a0 drivers/usb/core/driver.c:361
                   really_probe+0x281/0x6d0 drivers/base/dd.c:548
                   driver_probe_device+0x104/0x210 drivers/base/dd.c:721
                   __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:828
                   bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:430
                   __device_attach+0x217/0x360 drivers/base/dd.c:894
                   bus_probe_device+0x1e4/0x290 drivers/base/bus.c:490
                   device_add+0x1480/0x1c20 drivers/base/core.c:2487
                   usb_set_configuration+0xe67/0x1740 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/0x6d0 drivers/base/dd.c:548
                   driver_probe_device+0x104/0x210 drivers/base/dd.c:721
                   __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:828
                   bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:430
                   __device_attach+0x217/0x360 drivers/base/dd.c:894
                   bus_probe_device+0x1e4/0x290 drivers/base/bus.c:490
                   device_add+0x1480/0x1c20 drivers/base/core.c:2487
                   usb_new_device.cold+0x6a4/0xe79 drivers/usb/core/hub.c:2537
                   register_root_hub drivers/usb/core/hcd.c:1009 [inline]
                   usb_add_hcd.cold+0x1103/0x14aa drivers/usb/core/hcd.c:2793
                   dummy_hcd_probe+0x19f/0x312 drivers/usb/gadget/udc/dummy_hcd.c:2639
                   platform_drv_probe+0xce/0x1a0 drivers/base/platform.c:725
                   really_probe+0x281/0x6d0 drivers/base/dd.c:548
                   driver_probe_device+0x104/0x210 drivers/base/dd.c:721
                   __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:828
                   bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:430
                   __device_attach+0x217/0x360 drivers/base/dd.c:894
                   bus_probe_device+0x1e4/0x290 drivers/base/bus.c:490
                   device_add+0x1480/0x1c20 drivers/base/core.c:2487
                   platform_device_add+0x34d/0x6c0 drivers/base/platform.c:562
                   init+0x4b5/0x997 drivers/char/agp/backend.c:340
                   do_one_initcall+0xf0/0x620 init/main.c:939
                   do_initcall_level init/main.c:1007 [inline]
                   do_initcalls init/main.c:1015 [inline]
                   do_basic_setup init/main.c:1032 [inline]
                   kernel_init_freeable+0x4a4/0x548 init/main.c:1216
                   kernel_init+0xd/0x1b9 init/main.c:1110
                   ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352
 }
 ... key      at: [<ffffffff89c89380>] __key.37266+0x0/0x40
 ... acquired at:
   mark_lock_irq kernel/locking/lockdep.c:3317 [inline]
   mark_lock+0x510/0x1160 kernel/locking/lockdep.c:3666
   mark_usage kernel/locking/lockdep.c:3580 [inline]
   __lock_acquire+0x1188/0x3b60 kernel/locking/lockdep.c:3909
   lock_acquire+0x127/0x320 kernel/locking/lockdep.c:4485
   __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
   _raw_spin_lock+0x27/0x40 kernel/locking/spinlock.c:151
   spin_lock include/linux/spinlock.h:338 [inline]
   dummy_timer+0x1245/0x2fdb drivers/usb/gadget/udc/dummy_hcd.c:1967
   call_timer_fn+0x179/0x650 kernel/time/timer.c:1404
   expire_timers kernel/time/timer.c:1449 [inline]
   __run_timers kernel/time/timer.c:1773 [inline]
   __run_timers kernel/time/timer.c:1740 [inline]
   run_timer_softirq+0x5e3/0x1490 kernel/time/timer.c:1786
   __do_softirq+0x221/0x912 kernel/softirq.c:292
   invoke_softirq kernel/softirq.c:373 [inline]
   irq_exit+0x178/0x1a0 kernel/softirq.c:413
   exiting_irq arch/x86/include/asm/apic.h:536 [inline]
   smp_apic_timer_interrupt+0x12f/0x500 arch/x86/kernel/apic/apic.c:1137
   apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
   native_restore_fl arch/x86/include/asm/irqflags.h:41 [inline]
   arch_local_irq_restore arch/x86/include/asm/irqflags.h:84 [inline]
   console_unlock+0xa1b/0xc30 kernel/printk/printk.c:2481
   vprintk_emit+0x171/0x3d0 kernel/printk/printk.c:1996
   dev_vprintk_emit+0x4fc/0x541 drivers/base/core.c:3603
   dev_printk_emit+0xba/0xf1 drivers/base/core.c:3614
   __dev_printk+0x1db/0x203 drivers/base/core.c:3626
   _dev_info+0xd7/0x109 drivers/base/core.c:3672
   hub_port_init.cold+0x2e6/0x35b drivers/usb/core/hub.c:4604
   hub_port_connect drivers/usb/core/hub.c:5116 [inline]
   hub_port_connect_change drivers/usb/core/hub.c:5324 [inline]
   port_event drivers/usb/core/hub.c:5470 [inline]
   hub_event+0x1c7c/0x3860 drivers/usb/core/hub.c:5552
   process_one_work+0x92b/0x1530 kernel/workqueue.c:2264
   worker_thread+0x96/0xe20 kernel/workqueue.c:2410
   kthread+0x318/0x420 kernel/kthread.c:255
   ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352


stack backtrace:
CPU: 1 PID: 4170 Comm: kworker/1:7 Not tainted 5.5.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: usb_hub_wq hub_event
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0xef/0x16e lib/dump_stack.c:118
 print_irq_inversion_bug kernel/locking/lockdep.c:3180 [inline]
 check_usage_backwards.cold+0x1d/0x26 kernel/locking/lockdep.c:3231
 mark_lock_irq kernel/locking/lockdep.c:3317 [inline]
 mark_lock+0x510/0x1160 kernel/locking/lockdep.c:3666
 mark_usage kernel/locking/lockdep.c:3580 [inline]
 __lock_acquire+0x1188/0x3b60 kernel/locking/lockdep.c:3909
 lock_acquire+0x127/0x320 kernel/locking/lockdep.c:4485
 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
 _raw_spin_lock+0x27/0x40 kernel/locking/spinlock.c:151
 spin_lock include/linux/spinlock.h:338 [inline]
 dummy_timer+0x1245/0x2fdb drivers/usb/gadget/udc/dummy_hcd.c:1967
 call_timer_fn+0x179/0x650 kernel/time/timer.c:1404
 expire_timers kernel/time/timer.c:1449 [inline]
 __run_timers kernel/time/timer.c:1773 [inline]
 __run_timers kernel/time/timer.c:1740 [inline]
 run_timer_softirq+0x5e3/0x1490 kernel/time/timer.c:1786
 __do_softirq+0x221/0x912 kernel/softirq.c:292
 invoke_softirq kernel/softirq.c:373 [inline]
 irq_exit+0x178/0x1a0 kernel/softirq.c:413
 exiting_irq arch/x86/include/asm/apic.h:536 [inline]
 smp_apic_timer_interrupt+0x12f/0x500 arch/x86/kernel/apic/apic.c:1137
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
 </IRQ>
RIP: 0010:arch_local_irq_restore arch/x86/include/asm/irqflags.h:85 [inline]
RIP: 0010:console_unlock+0xa1b/0xc30 kernel/printk/printk.c:2481
Code: 00 89 ee 48 c7 c7 c0 6a f3 86 e8 30 bb 03 00 65 ff 0d d1 04 d9 7e e9 ea f9 ff ff e8 9f f5 15 00 e8 8a 38 1b 00 ff 74 24 30 9d <e9> 18 fe ff ff e8 8b f5 15 00 48 8d 7d 08 48 89 f8 48 c1 e8 03 42
RSP: 0018:ffff8881c7377620 EFLAGS: 00000212 ORIG_RAX: ffffffffffffff13
RAX: 0000000000000007 RBX: 0000000000000200 RCX: 0000000000000006
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff8881d2d920cc
RBP: 0000000000000000 R08: ffff8881d2d91880 R09: fffffbfff11f20ad
R10: fffffbfff11f20ac R11: ffffffff88f90567 R12: 0000000000000054
R13: dffffc0000000000 R14: ffffffff829b1110 R15: ffffffff87283510
 vprintk_emit+0x171/0x3d0 kernel/printk/printk.c:1996
 dev_vprintk_emit+0x4fc/0x541 drivers/base/core.c:3603
 dev_printk_emit+0xba/0xf1 drivers/base/core.c:3614
 __dev_printk+0x1db/0x203 drivers/base/core.c:3626
 _dev_info+0xd7/0x109 drivers/base/core.c:3672
 hub_port_init.cold+0x2e6/0x35b drivers/usb/core/hub.c:4604
 hub_port_connect drivers/usb/core/hub.c:5116 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5324 [inline]
 port_event drivers/usb/core/hub.c:5470 [inline]
 hub_event+0x1c7c/0x3860 drivers/usb/core/hub.c:5552
 process_one_work+0x92b/0x1530 kernel/workqueue.c:2264
 worker_thread+0x96/0xe20 kernel/workqueue.c:2410
 kthread+0x318/0x420 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352
usb 3-1: dlfb_urb_completion - nonzero write bulk status received: -71
usb 3-1: dlfb_urb_completion - nonzero write bulk status received: -71

Crashes (19):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/12/18 17:24 https://github.com/google/kasan.git usb-fuzzer d533c9925862 64ca0a37 .config console log report ci2-upstream-usb
2019/12/18 17:01 https://github.com/google/kasan.git usb-fuzzer d533c9925862 64ca0a37 .config console log report ci2-upstream-usb
2019/12/18 16:55 https://github.com/google/kasan.git usb-fuzzer d533c9925862 64ca0a37 .config console log report ci2-upstream-usb
2019/12/18 15:53 https://github.com/google/kasan.git usb-fuzzer d533c9925862 64ca0a37 .config console log report ci2-upstream-usb
2019/12/18 14:54 https://github.com/google/kasan.git usb-fuzzer d533c9925862 64ca0a37 .config console log report ci2-upstream-usb
2019/12/18 12:56 https://github.com/google/kasan.git usb-fuzzer d533c9925862 64ca0a37 .config console log report ci2-upstream-usb
2019/12/18 11:45 https://github.com/google/kasan.git usb-fuzzer d533c9925862 64ca0a37 .config console log report ci2-upstream-usb
2019/12/18 11:23 https://github.com/google/kasan.git usb-fuzzer d533c9925862 64ca0a37 .config console log report ci2-upstream-usb
2019/12/18 10:55 https://github.com/google/kasan.git usb-fuzzer d533c9925862 64ca0a37 .config console log report ci2-upstream-usb
2019/12/18 10:19 https://github.com/google/kasan.git usb-fuzzer d533c9925862 64ca0a37 .config console log report ci2-upstream-usb
2019/12/18 08:31 https://github.com/google/kasan.git usb-fuzzer d533c9925862 64ca0a37 .config console log report ci2-upstream-usb
2019/12/18 06:31 https://github.com/google/kasan.git usb-fuzzer d533c9925862 64ca0a37 .config console log report ci2-upstream-usb
2019/12/18 03:50 https://github.com/google/kasan.git usb-fuzzer d533c9925862 1af3875f .config console log report ci2-upstream-usb
2019/12/18 02:42 https://github.com/google/kasan.git usb-fuzzer d533c9925862 1af3875f .config console log report ci2-upstream-usb
2019/12/18 02:32 https://github.com/google/kasan.git usb-fuzzer d533c9925862 1af3875f .config console log report ci2-upstream-usb
2019/12/18 02:19 https://github.com/google/kasan.git usb-fuzzer d533c9925862 1af3875f .config console log report ci2-upstream-usb
2019/12/18 01:27 https://github.com/google/kasan.git usb-fuzzer d533c9925862 1af3875f .config console log report ci2-upstream-usb
2019/12/18 00:03 https://github.com/google/kasan.git usb-fuzzer d533c9925862 1af3875f .config console log report ci2-upstream-usb
2019/12/17 23:21 https://github.com/google/kasan.git usb-fuzzer d533c9925862 1af3875f .config console log report ci2-upstream-usb
* Struck through repros no longer work on HEAD.