xpad 4-1:0.65: xpad_irq_in - usb_submit_urb failed with result -19 xpad 4-1:0.65: xpad_irq_out - usb_submit_urb failed with result -19 ================================================================== BUG: KASAN: use-after-free in register_lock_class+0xf45/0x1170 kernel/locking/lockdep.c:1291 Read of size 1 at addr ffff8881335fe091 by task systemd-udevd/10951 CPU: 1 PID: 10951 Comm: systemd-udevd Not tainted 5.12.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0xfa/0x151 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232 __kasan_report mm/kasan/report.c:399 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416 register_lock_class+0xf45/0x1170 kernel/locking/lockdep.c:1291 __lock_acquire+0x106/0x54c0 kernel/locking/lockdep.c:4779 lock_acquire kernel/locking/lockdep.c:5510 [inline] lock_acquire+0x19d/0x6f0 kernel/locking/lockdep.c:5475 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x36/0x50 kernel/locking/spinlock.c:159 __wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:137 usb_anchor_resume_wakeups drivers/usb/core/urb.c:937 [inline] usb_anchor_resume_wakeups+0xbe/0xe0 drivers/usb/core/urb.c:930 __usb_hcd_giveback_urb+0x2df/0x5c0 drivers/usb/core/hcd.c:1659 usb_hcd_giveback_urb+0x367/0x410 drivers/usb/core/hcd.c:1726 dummy_timer+0x11f4/0x32a0 drivers/usb/gadget/udc/dummy_hcd.c:1971 call_timer_fn+0x1a5/0x630 kernel/time/timer.c:1431 expire_timers kernel/time/timer.c:1476 [inline] __run_timers.part.0+0x67c/0xa10 kernel/time/timer.c:1745 __run_timers kernel/time/timer.c:1726 [inline] run_timer_softirq+0x80/0x120 kernel/time/timer.c:1758 __do_softirq+0x1b0/0x944 kernel/softirq.c:345 invoke_softirq kernel/softirq.c:221 [inline] __irq_exit_rcu kernel/softirq.c:422 [inline] irq_exit_rcu+0x110/0x1a0 kernel/softirq.c:434 sysvec_apic_timer_interrupt+0x6a/0x90 arch/x86/kernel/apic/apic.c:1100 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:632 RIP: 0010:tomoyo_compare_number_union security/tomoyo/file.c:117 [inline] RIP: 0010:tomoyo_compare_number_union security/tomoyo/file.c:112 [inline] RIP: 0010:tomoyo_check_path_number_acl+0x125/0x320 security/tomoyo/file.c:282 Code: 8b 75 40 4d 85 f6 0f 85 12 01 00 00 e8 e4 06 65 ff 48 8d 7d 30 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 <0f> 85 ae 01 00 00 48 8b 5d 30 4c 89 ef 48 89 de e8 b6 0c 65 ff 49 RSP: 0018:ffffc9001168f570 EFLAGS: 00000246 RAX: dffffc0000000000 RBX: 0000000000000001 RCX: 0000000000000000 RDX: 1ffff110201e56d6 RSI: ffffffff81da8b8c RDI: ffff888100f2b6b0 RBP: ffff888100f2b680 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff81da8b19 R11: 000000000000001f R12: ffffc9001168f668 R13: 0000000000000180 R14: 0000000000000000 R15: 0000000000000002 tomoyo_check_acl+0x13c/0x450 security/tomoyo/domain.c:175 tomoyo_path_number_perm+0x32a/0x590 security/tomoyo/file.c:733 tomoyo_path_mknod+0x10d/0x190 security/tomoyo/tomoyo.c:240 security_path_mknod+0xf9/0x170 security/security.c:1087 may_o_create fs/namei.c:3038 [inline] lookup_open.isra.0+0x471/0x1300 fs/namei.c:3182 open_last_lookups fs/namei.c:3289 [inline] path_openat+0x9b4/0x27e0 fs/namei.c:3495 do_filp_open+0x17e/0x3c0 fs/namei.c:3525 do_sys_openat2+0x16d/0x420 fs/open.c:1187 do_sys_open fs/open.c:1203 [inline] __do_sys_open fs/open.c:1211 [inline] __se_sys_open fs/open.c:1207 [inline] __x64_sys_open+0x119/0x1c0 fs/open.c:1207 do_syscall_64+0x2d/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f6cce7106f0 Code: 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 83 3d 19 30 2c 00 00 75 10 b8 02 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 fe 9d 01 00 48 89 04 24 RSP: 002b:00007ffc4b6116b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f6cce7106f0 RDX: 0000000000000180 RSI: 00000000000800c2 RDI: 00005585be6a3060 RBP: 000000000003a2f8 R08: 000000000000fcfe R09: 0000000000000030 R10: 0000000000000000 R11: 0000000000000246 R12: 00005585be6a3077 R13: 8421084210842109 R14: 00000000000800c2 R15: 00007f6cce79e540 Allocated by task 17: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:427 [inline] ____kasan_kmalloc mm/kasan/common.c:506 [inline] __kasan_kmalloc+0x7a/0x90 mm/kasan/common.c:515 kmalloc include/linux/slab.h:554 [inline] kzalloc include/linux/slab.h:684 [inline] xpad_probe+0x26c/0x1c20 drivers/input/joystick/xpad.c:1747 usb_probe_interface+0x315/0x7f0 drivers/usb/core/driver.c:396 really_probe+0x291/0xe60 drivers/base/dd.c:554 driver_probe_device+0x26b/0x3d0 drivers/base/dd.c:740 __device_attach_driver+0x1d1/0x290 drivers/base/dd.c:846 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:431 __device_attach+0x228/0x4a0 drivers/base/dd.c:914 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491 device_add+0xbdb/0x1db0 drivers/base/core.c:3242 usb_set_configuration+0x113f/0x1910 drivers/usb/core/message.c:2164 usb_generic_driver_probe+0xba/0x100 drivers/usb/core/generic.c:238 usb_probe_device+0xd9/0x2c0 drivers/usb/core/driver.c:293 really_probe+0x291/0xe60 drivers/base/dd.c:554 driver_probe_device+0x26b/0x3d0 drivers/base/dd.c:740 __device_attach_driver+0x1d1/0x290 drivers/base/dd.c:846 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:431 __device_attach+0x228/0x4a0 drivers/base/dd.c:914 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491 device_add+0xbdb/0x1db0 drivers/base/core.c:3242 usb_new_device.cold+0x721/0x1058 drivers/usb/core/hub.c:2555 hub_port_connect drivers/usb/core/hub.c:5223 [inline] hub_port_connect_change drivers/usb/core/hub.c:5363 [inline] port_event drivers/usb/core/hub.c:5509 [inline] hub_event+0x2357/0x4320 drivers/usb/core/hub.c:5591 process_one_work+0x98d/0x1580 kernel/workqueue.c:2275 worker_thread+0x64c/0x1120 kernel/workqueue.c:2421 kthread+0x38c/0x460 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Freed by task 5: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:357 ____kasan_slab_free mm/kasan/common.c:360 [inline] ____kasan_slab_free mm/kasan/common.c:325 [inline] __kasan_slab_free+0xda/0x110 mm/kasan/common.c:367 kasan_slab_free include/linux/kasan.h:199 [inline] slab_free_hook mm/slub.c:1562 [inline] slab_free_freelist_hook+0x51/0x130 mm/slub.c:1600 slab_free mm/slub.c:3161 [inline] kfree+0xdb/0x3a0 mm/slub.c:4213 xpad_disconnect+0x1cb/0x530 drivers/input/joystick/xpad.c:1895 usb_unbind_interface+0x1d8/0x8d0 drivers/usb/core/driver.c:458 __device_release_driver+0x3bd/0x6f0 drivers/base/dd.c:1156 device_release_driver_internal drivers/base/dd.c:1187 [inline] device_release_driver+0x26/0x40 drivers/base/dd.c:1210 bus_remove_device+0x2eb/0x5a0 drivers/base/bus.c:533 device_del+0x502/0xd40 drivers/base/core.c:3421 usb_disable_device+0x35b/0x7b0 drivers/usb/core/message.c:1413 usb_disconnect.cold+0x27d/0x791 drivers/usb/core/hub.c:2218 hub_port_connect drivers/usb/core/hub.c:5074 [inline] hub_port_connect_change drivers/usb/core/hub.c:5363 [inline] port_event drivers/usb/core/hub.c:5509 [inline] hub_event+0x1c9c/0x4320 drivers/usb/core/hub.c:5591 process_one_work+0x98d/0x1580 kernel/workqueue.c:2275 worker_thread+0x64c/0x1120 kernel/workqueue.c:2421 kthread+0x38c/0x460 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 The buggy address belongs to the object at ffff8881335fe000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 145 bytes inside of 1024-byte region [ffff8881335fe000, ffff8881335fe400) The buggy address belongs to the page: page:00000000df9ccae2 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8881335fb000 pfn:0x1335f8 head:00000000df9ccae2 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x200000000010200(slab|head) raw: 0200000000010200 0000000000000000 0000000100000001 ffff888100041dc0 raw: ffff8881335fb000 000000008010000e 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881335fdf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881335fe000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881335fe080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881335fe100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881335fe180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================