xpad 1-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19 xpad 1-1:179.65: xpad_irq_out - usb_submit_urb failed with result -19 ================================================================== BUG: KASAN: slab-use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] BUG: KASAN: slab-use-after-free in do_raw_spin_lock+0x265/0x2b0 kernel/locking/spinlock_debug.c:114 Read of size 4 at addr ffff88804175805c by task syz-executor.3/18721 CPU: 0 PID: 18721 Comm: syz-executor.3 Not tainted 6.3.0-syzkaller-11025-g89d77f71f493 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] do_raw_spin_lock+0x265/0x2b0 kernel/locking/spinlock_debug.c:114 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x45/0x60 kernel/locking/spinlock.c:162 __wake_up_common_lock+0xb8/0x140 kernel/sched/wait.c:137 usb_anchor_resume_wakeups drivers/usb/core/urb.c:960 [inline] usb_anchor_resume_wakeups+0xc2/0xe0 drivers/usb/core/urb.c:953 __usb_hcd_giveback_urb+0x2e5/0x5c0 drivers/usb/core/hcd.c:1674 usb_hcd_giveback_urb+0x384/0x430 drivers/usb/core/hcd.c:1754 dummy_timer+0x13b6/0x3400 drivers/usb/gadget/udc/dummy_hcd.c:1988 call_timer_fn+0x1a0/0x580 kernel/time/timer.c:1700 expire_timers+0x29b/0x4b0 kernel/time/timer.c:1751 __run_timers kernel/time/timer.c:2022 [inline] __run_timers kernel/time/timer.c:1995 [inline] run_timer_softirq+0x326/0x910 kernel/time/timer.c:2035 __do_softirq+0x1d4/0x905 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x114/0x190 kernel/softirq.c:650 irq_exit_rcu+0x9/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x97/0xc0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:__sanitizer_cov_trace_pc+0x0/0x70 kernel/kcov.c:200 Code: b6 21 8e 02 66 0f 1f 44 00 00 f3 0f 1e fa 48 8b be a8 01 00 00 e8 b0 ff ff ff 31 c0 c3 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 0f 1e fa 65 8b 05 cd 6a 7f 7e 89 c1 48 8b 34 24 81 e1 00 01 00 RSP: 0018:ffffc900069ef270 EFLAGS: 00000246 RAX: 0000000000040000 RBX: 0000000000000200 RCX: ffffc9000c52a000 RDX: 0000000000040000 RSI: ffffffff81686875 RDI: 0000000000000007 RBP: ffffffff8d263038 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000200 R11: 0000000000000000 R12: 0000000000000000 R13: ffffffff8d262fe0 R14: dffffc0000000000 R15: 0000000000000001 console_emit_next_record arch/x86/include/asm/irqflags.h:42 [inline] console_flush_all+0x61b/0xcc0 kernel/printk/printk.c:2933 console_unlock+0xb8/0x1f0 kernel/printk/printk.c:3007 do_con_write+0xc6d/0x1e70 drivers/tty/vt/vt.c:2919 con_write+0x25/0x40 drivers/tty/vt/vt.c:3246 process_output_block drivers/tty/n_tty.c:585 [inline] n_tty_write+0x4ce/0xfd0 drivers/tty/n_tty.c:2349 do_tty_write drivers/tty/tty_io.c:1018 [inline] file_tty_write.constprop.0+0x453/0x9c0 drivers/tty/tty_io.c:1089 call_write_iter include/linux/fs.h:1854 [inline] do_iter_readv_writev+0x20b/0x3b0 fs/read_write.c:735 do_iter_write+0x185/0x7e0 fs/read_write.c:860 vfs_iter_write+0x74/0xa0 fs/read_write.c:901 iter_file_splice_write+0x743/0xc80 fs/splice.c:779 do_splice_from fs/splice.c:857 [inline] direct_splice_actor+0x114/0x180 fs/splice.c:1023 splice_direct_to_actor+0x335/0x8a0 fs/splice.c:978 do_splice_direct+0x1ab/0x280 fs/splice.c:1066 do_sendfile+0xb19/0x12c0 fs/read_write.c:1254 __do_compat_sys_sendfile fs/read_write.c:1343 [inline] __se_compat_sys_sendfile fs/read_write.c:1326 [inline] __ia32_compat_sys_sendfile+0x1e1/0x220 fs/read_write.c:1326 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 RIP: 0023:0xf7f04579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f5dfe5cc EFLAGS: 00000296 ORIG_RAX: 00000000000000bb RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 0000000000000005 RDX: 0000000000000000 RSI: 000000007ffff003 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 5092: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] ____kasan_kmalloc mm/kasan/common.c:333 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:559 [inline] kzalloc include/linux/slab.h:680 [inline] xpad_probe+0x27b/0x1ed0 drivers/input/joystick/xpad.c:1957 usb_probe_interface+0x30f/0x960 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x240/0xca0 drivers/base/dd.c:658 __driver_probe_device+0x1df/0x4b0 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830 __device_attach_driver+0x1d4/0x2e0 drivers/base/dd.c:958 bus_for_each_drv+0x149/0x1d0 drivers/base/bus.c:457 __device_attach+0x1e4/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532 device_add+0x112d/0x1a40 drivers/base/core.c:3625 usb_set_configuration+0x1196/0x1bc0 drivers/usb/core/message.c:2211 usb_generic_driver_probe+0xcf/0x130 drivers/usb/core/generic.c:238 usb_probe_device+0xd8/0x2c0 drivers/usb/core/driver.c:293 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x240/0xca0 drivers/base/dd.c:658 __driver_probe_device+0x1df/0x4b0 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830 __device_attach_driver+0x1d4/0x2e0 drivers/base/dd.c:958 bus_for_each_drv+0x149/0x1d0 drivers/base/bus.c:457 __device_attach+0x1e4/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532 device_add+0x112d/0x1a40 drivers/base/core.c:3625 usb_new_device+0xcb2/0x19d0 drivers/usb/core/hub.c:2575 hub_port_connect drivers/usb/core/hub.c:5407 [inline] hub_port_connect_change drivers/usb/core/hub.c:5551 [inline] port_event drivers/usb/core/hub.c:5711 [inline] hub_event+0x2d9e/0x4e40 drivers/usb/core/hub.c:5793 process_one_work+0x991/0x15c0 kernel/workqueue.c:2390 worker_thread+0x669/0x1090 kernel/workqueue.c:2537 kthread+0x344/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Freed by task 5117: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1807 slab_free mm/slub.c:3786 [inline] __kmem_cache_free+0xaf/0x2d0 mm/slub.c:3799 xpad_disconnect+0x1cf/0x580 drivers/input/joystick/xpad.c:2138 usb_unbind_interface+0x1dc/0x8e0 drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:569 [inline] device_remove+0x11f/0x170 drivers/base/dd.c:561 __device_release_driver drivers/base/dd.c:1272 [inline] device_release_driver_internal+0x443/0x610 drivers/base/dd.c:1295 bus_remove_device+0x22c/0x420 drivers/base/bus.c:574 device_del+0x399/0xa30 drivers/base/core.c:3814 usb_disable_device+0x360/0x7b0 drivers/usb/core/message.c:1420 usb_disconnect+0x2db/0x8a0 drivers/usb/core/hub.c:2238 hub_port_connect drivers/usb/core/hub.c:5246 [inline] hub_port_connect_change drivers/usb/core/hub.c:5551 [inline] port_event drivers/usb/core/hub.c:5711 [inline] hub_event+0x1fbf/0x4e40 drivers/usb/core/hub.c:5793 process_one_work+0x991/0x15c0 kernel/workqueue.c:2390 worker_thread+0x669/0x1090 kernel/workqueue.c:2537 kthread+0x344/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff888041758000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 92 bytes inside of freed 1024-byte region [ffff888041758000, ffff888041758400) The buggy address belongs to the physical page: page:ffffea000105d600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x41758 head:ffffea000105d600 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff888012441dc0 ffffea0001e82c00 dead000000000002 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 7942, tgid 7942 (kworker/u4:6), ts 537130613444, free_ts 537074854173 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1722 prep_new_page mm/page_alloc.c:1729 [inline] get_page_from_freelist+0xf41/0x2c00 mm/page_alloc.c:3493 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4759 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2277 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x390 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3192 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3291 __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] __kmem_cache_alloc_node+0x136/0x320 mm/slub.c:3490 __do_kmalloc_node mm/slab_common.c:965 [inline] __kmalloc+0x4e/0x190 mm/slab_common.c:979 kmalloc include/linux/slab.h:563 [inline] kzalloc include/linux/slab.h:680 [inline] ieee802_11_parse_elems_full+0x106/0x1340 net/mac80211/util.c:1609 ieee802_11_parse_elems_crc.constprop.0+0x99/0xd0 net/mac80211/ieee80211_i.h:2305 ieee802_11_parse_elems net/mac80211/ieee80211_i.h:2312 [inline] ieee80211_bss_info_update+0x410/0xb50 net/mac80211/scan.c:212 ieee80211_rx_bss_info net/mac80211/ibss.c:1120 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1609 [inline] ieee80211_ibss_rx_queued_mgmt+0x19c9/0x3030 net/mac80211/ibss.c:1638 ieee80211_iface_process_skb net/mac80211/iface.c:1594 [inline] ieee80211_iface_work+0xa4d/0xd70 net/mac80211/iface.c:1648 process_one_work+0x991/0x15c0 kernel/workqueue.c:2390 worker_thread+0x669/0x1090 kernel/workqueue.c:2537 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x62e/0xcb0 mm/page_alloc.c:2555 free_unref_page+0x33/0x370 mm/page_alloc.c:2650 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2636 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x195/0x220 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x63/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:711 [inline] slab_alloc_node mm/slub.c:3451 [inline] __kmem_cache_alloc_node+0x17c/0x320 mm/slub.c:3490 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1057 kmalloc include/linux/slab.h:559 [inline] kzalloc include/linux/slab.h:680 [inline] kernfs_fop_open+0x31e/0xe70 fs/kernfs/file.c:670 do_dentry_open+0x6cc/0x13f0 fs/open.c:920 do_open fs/namei.c:3560 [inline] path_openat+0x1baa/0x2750 fs/namei.c:3715 do_filp_open+0x1ba/0x410 fs/namei.c:3742 do_sys_openat2+0x16d/0x4c0 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_openat fs/open.c:1388 [inline] __se_sys_openat fs/open.c:1383 [inline] __x64_sys_openat+0x143/0x1f0 fs/open.c:1383 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888041757f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888041757f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888041758000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888041758080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888041758100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: b6 21 mov $0x21,%dh 2: 8e 02 mov (%rdx),%es 4: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) a: f3 0f 1e fa endbr64 e: 48 8b be a8 01 00 00 mov 0x1a8(%rsi),%rdi 15: e8 b0 ff ff ff callq 0xffffffca 1a: 31 c0 xor %eax,%eax 1c: c3 retq 1d: 66 66 2e 0f 1f 84 00 data16 nopw %cs:0x0(%rax,%rax,1) 24: 00 00 00 00 28: 66 90 xchg %ax,%ax * 2a: f3 0f 1e fa endbr64 <-- trapping instruction 2e: 65 8b 05 cd 6a 7f 7e mov %gs:0x7e7f6acd(%rip),%eax # 0x7e7f6b02 35: 89 c1 mov %eax,%ecx 37: 48 8b 34 24 mov (%rsp),%rsi 3b: 81 .byte 0x81 3c: e1 00 loope 0x3e 3e: 01 00 add %eax,(%rax)