powermate: config urb returned -71 powermate 2-1:0.0: powermate_irq - usb_submit_urb failed with result: -19 powermate: config urb returned -108 ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3ee7/0x56d0 kernel/locking/lockdep.c:4925 Read of size 8 at addr ffff888075431658 by task swapper/1/0 CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.1.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x57/0x7d lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15e/0x45d mm/kasan/report.c:395 kasan_report+0xbb/0x1f0 mm/kasan/report.c:495 __lock_acquire+0x3ee7/0x56d0 kernel/locking/lockdep.c:4925 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1df/0x630 kernel/locking/lockdep.c:5633 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162 powermate_config_complete+0x66/0x90 drivers/input/misc/powermate.c:202 __usb_hcd_giveback_urb+0x238/0x3f0 drivers/usb/core/hcd.c:1671 dummy_timer+0xeb8/0x2e40 drivers/usb/gadget/udc/dummy_hcd.c:1988 call_timer_fn+0x19b/0x5b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers.part.0+0x56b/0x9a0 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0x9c/0x190 kernel/time/timer.c:1803 __do_softirq+0x1f7/0xad8 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1107 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0010:native_save_fl arch/x86/include/asm/irqflags.h:29 [inline] RIP: 0010:arch_local_save_flags arch/x86/include/asm/irqflags.h:70 [inline] RIP: 0010:arch_irqs_disabled arch/x86/include/asm/irqflags.h:130 [inline] RIP: 0010:acpi_safe_halt drivers/acpi/processor_idle.c:113 [inline] RIP: 0010:acpi_idle_do_entry+0x185/0x200 drivers/acpi/processor_idle.c:572 Code: 00 00 00 00 00 fc ff df 48 c1 ea 03 80 3c 02 00 75 65 48 8b 45 00 a8 08 75 c9 e8 26 8f b4 f8 66 90 0f 00 2d dd 37 ce 00 fb f4 <9c> 58 fa f6 c4 02 74 b1 5d e9 bd 8d b4 f8 48 89 ef 5d e9 c4 f2 ff RSP: 0018:ffffc90000177d28 EFLAGS: 00000246 RAX: 00000000001c79a3 RBX: ffff888010fd2065 RCX: 1ffffffff19e34f1 RDX: 0000000000000000 RSI: ffffffff892bde60 RDI: ffffffff898583e0 RBP: ffff888010fb1d40 R08: 0000000000000001 R09: 0000000000000001 R10: ffffed10021f63a8 R11: 0000000000000001 R12: 0000000000000001 R13: ffff888010fd2064 R14: ffffffff8bb84740 R15: ffff88814668e804 acpi_idle_enter+0x2c3/0x4c0 drivers/acpi/processor_idle.c:709 cpuidle_enter_state+0x152/0xc40 drivers/cpuidle/cpuidle.c:239 cpuidle_enter+0x45/0xa0 drivers/cpuidle/cpuidle.c:356 call_cpuidle kernel/sched/idle.c:155 [inline] cpuidle_idle_call kernel/sched/idle.c:236 [inline] do_idle+0x3f7/0x590 kernel/sched/idle.c:303 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:400 start_secondary+0x252/0x300 arch/x86/kernel/smpboot.c:262 secondary_startup_64_no_verify+0xce/0xdb Allocated by task 146: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_kmalloc+0xa1/0xb0 mm/kasan/common.c:380 kmalloc include/linux/slab.h:553 [inline] kzalloc include/linux/slab.h:689 [inline] powermate_probe+0x1fc/0x12f0 drivers/input/misc/powermate.c:323 usb_probe_interface+0x274/0x6a0 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:560 [inline] really_probe+0x5a6/0xa50 drivers/base/dd.c:639 __driver_probe_device+0x186/0x460 drivers/base/dd.c:778 driver_probe_device+0x44/0x110 drivers/base/dd.c:808 __device_attach_driver+0x14a/0x270 drivers/base/dd.c:936 bus_for_each_drv+0x11e/0x1a0 drivers/base/bus.c:427 __device_attach+0x19e/0x440 drivers/base/dd.c:1008 bus_probe_device+0x19d/0x250 drivers/base/bus.c:487 device_add+0xa14/0x1b80 drivers/base/core.c:3517 usb_set_configuration+0xa01/0x18a0 drivers/usb/core/message.c:2170 usb_generic_driver_probe+0x74/0xa0 drivers/usb/core/generic.c:238 usb_probe_device+0x94/0x230 drivers/usb/core/driver.c:293 call_driver_probe drivers/base/dd.c:560 [inline] really_probe+0x5a6/0xa50 drivers/base/dd.c:639 __driver_probe_device+0x186/0x460 drivers/base/dd.c:778 driver_probe_device+0x44/0x110 drivers/base/dd.c:808 __device_attach_driver+0x14a/0x270 drivers/base/dd.c:936 bus_for_each_drv+0x11e/0x1a0 drivers/base/bus.c:427 __device_attach+0x19e/0x440 drivers/base/dd.c:1008 bus_probe_device+0x19d/0x250 drivers/base/bus.c:487 device_add+0xa14/0x1b80 drivers/base/core.c:3517 usb_new_device.cold+0x600/0xf02 drivers/usb/core/hub.c:2573 hub_port_connect drivers/usb/core/hub.c:5353 [inline] hub_port_connect_change drivers/usb/core/hub.c:5497 [inline] port_event drivers/usb/core/hub.c:5653 [inline] hub_event+0x1c58/0x3a90 drivers/usb/core/hub.c:5735 process_one_work+0x8ba/0x14b0 kernel/workqueue.c:2289 worker_thread+0x598/0xec0 kernel/workqueue.c:2436 kthread+0x294/0x330 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Freed by task 4125: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2a/0x40 mm/kasan/generic.c:511 ____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:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1750 slab_free mm/slub.c:3661 [inline] __kmem_cache_free+0xab/0x3b0 mm/slub.c:3674 usb_unbind_interface+0x183/0x7e0 drivers/usb/core/driver.c:458 __device_release_driver drivers/base/dd.c:1249 [inline] device_release_driver_internal+0x3bc/0x600 drivers/base/dd.c:1275 bus_remove_device+0x295/0x550 drivers/base/bus.c:529 device_del+0x48d/0xb80 drivers/base/core.c:3704 usb_disable_device+0x29c/0x650 drivers/usb/core/message.c:1419 usb_disconnect.cold+0x1f5/0x623 drivers/usb/core/hub.c:2235 hub_port_connect drivers/usb/core/hub.c:5197 [inline] hub_port_connect_change drivers/usb/core/hub.c:5497 [inline] port_event drivers/usb/core/hub.c:5653 [inline] hub_event+0x165f/0x3a90 drivers/usb/core/hub.c:5735 process_one_work+0x8ba/0x14b0 kernel/workqueue.c:2289 worker_thread+0x598/0xec0 kernel/workqueue.c:2436 kthread+0x294/0x330 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:481 call_rcu+0x99/0x820 kernel/rcu/tree.c:2798 free_fib_info net/ipv4/fib_semantics.c:256 [inline] fib_create_info+0x1c32/0x4160 net/ipv4/fib_semantics.c:1580 fib_table_insert+0x155/0x1e20 net/ipv4/fib_trie.c:1236 fib_magic+0x363/0x470 net/ipv4/fib_frontend.c:1098 fib_add_ifaddr+0x2d8/0x4c0 net/ipv4/fib_frontend.c:1135 fib_inetaddr_event+0x13a/0x260 net/ipv4/fib_frontend.c:1434 notifier_call_chain+0x94/0x170 kernel/notifier.c:87 blocking_notifier_call_chain kernel/notifier.c:382 [inline] blocking_notifier_call_chain+0x5d/0x80 kernel/notifier.c:370 __inet_insert_ifa+0x770/0xa20 net/ipv4/devinet.c:554 inet_insert_ifa net/ipv4/devinet.c:561 [inline] inetdev_event+0xee9/0x1200 net/ipv4/devinet.c:1574 notifier_call_chain+0x94/0x170 kernel/notifier.c:87 call_netdevice_notifiers_extack net/core/dev.c:1983 [inline] call_netdevice_notifiers net/core/dev.c:1997 [inline] __dev_notify_flags+0xd0/0x230 net/core/dev.c:8581 dev_change_flags+0xf6/0x150 net/core/dev.c:8619 do_setlink+0x873/0x2dd0 net/core/rtnetlink.c:2788 __rtnl_newlink+0x94d/0x14c0 net/core/rtnetlink.c:3547 rtnl_newlink+0x5a/0x90 net/core/rtnetlink.c:3594 rtnetlink_rcv_msg+0x32d/0x9a0 net/core/rtnetlink.c:6091 netlink_rcv_skb+0x118/0x370 net/netlink/af_netlink.c:2540 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x433/0x710 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x782/0xc30 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:734 __sys_sendto+0x1bb/0x290 net/socket.c:2117 __do_sys_sendto net/socket.c:2129 [inline] __se_sys_sendto net/socket.c:2125 [inline] __x64_sys_sendto+0xd8/0x1b0 net/socket.c:2125 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:481 call_rcu+0x99/0x820 kernel/rcu/tree.c:2798 free_fib_info net/ipv4/fib_semantics.c:256 [inline] fib_create_info+0x1c32/0x4160 net/ipv4/fib_semantics.c:1580 fib_table_insert+0x155/0x1e20 net/ipv4/fib_trie.c:1236 fib_magic+0x363/0x470 net/ipv4/fib_frontend.c:1098 fib_add_ifaddr+0x14e/0x4c0 net/ipv4/fib_frontend.c:1120 fib_netdev_event+0x319/0x4a0 net/ipv4/fib_frontend.c:1480 notifier_call_chain+0x94/0x170 kernel/notifier.c:87 call_netdevice_notifiers_extack net/core/dev.c:1983 [inline] call_netdevice_notifiers net/core/dev.c:1997 [inline] __dev_notify_flags+0xd0/0x230 net/core/dev.c:8581 dev_change_flags+0xf6/0x150 net/core/dev.c:8619 do_setlink+0x873/0x2dd0 net/core/rtnetlink.c:2788 __rtnl_newlink+0x94d/0x14c0 net/core/rtnetlink.c:3547 rtnl_newlink+0x5a/0x90 net/core/rtnetlink.c:3594 rtnetlink_rcv_msg+0x32d/0x9a0 net/core/rtnetlink.c:6091 netlink_rcv_skb+0x118/0x370 net/netlink/af_netlink.c:2540 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x433/0x710 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x782/0xc30 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:734 __sys_sendto+0x1bb/0x290 net/socket.c:2117 __do_sys_sendto net/socket.c:2129 [inline] __se_sys_sendto net/socket.c:2125 [inline] __x64_sys_sendto+0xd8/0x1b0 net/socket.c:2125 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888075431600 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 88 bytes inside of 256-byte region [ffff888075431600, ffff888075431700) The buggy address belongs to the physical page: page:ffffea0001d50c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x75430 head:ffffea0001d50c00 order:1 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888010c41b40 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4094, tgid 4094 (syz-executor.2), ts 72825907076, free_ts 72610330540 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4288 __alloc_pages+0x1c7/0x5a0 mm/page_alloc.c:5555 alloc_slab_page mm/slub.c:1794 [inline] allocate_slab+0x213/0x300 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3180 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3279 slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x191/0x3e0 mm/slub.c:3437 kmalloc_trace+0x22/0x60 mm/slab_common.c:1045 kmalloc include/linux/slab.h:553 [inline] kzalloc include/linux/slab.h:689 [inline] ____ip_mc_inc_group+0x1a7/0xa10 net/ipv4/igmp.c:1449 __ip_mc_inc_group net/ipv4/igmp.c:1484 [inline] ip_mc_inc_group net/ipv4/igmp.c:1490 [inline] ip_mc_up+0x12d/0x2b0 net/ipv4/igmp.c:1789 inetdev_event+0x1fe/0x1200 net/ipv4/devinet.c:1577 notifier_call_chain+0x94/0x170 kernel/notifier.c:87 call_netdevice_notifiers_extack net/core/dev.c:1983 [inline] call_netdevice_notifiers net/core/dev.c:1997 [inline] __dev_notify_flags+0xd0/0x230 net/core/dev.c:8581 dev_change_flags+0xf6/0x150 net/core/dev.c:8619 do_setlink+0x873/0x2dd0 net/core/rtnetlink.c:2788 __rtnl_newlink+0x94d/0x14c0 net/core/rtnetlink.c:3547 rtnl_newlink+0x5a/0x90 net/core/rtnetlink.c:3594 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1509 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3483 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2586 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x62/0x80 mm/kasan/common.c:302 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x2ac/0x3c0 mm/slub.c:3422 vm_area_alloc+0x17/0xe0 kernel/fork.c:458 mmap_region+0x359/0x1a60 mm/mmap.c:2605 do_mmap+0x5a6/0xd30 mm/mmap.c:1412 vm_mmap_pgoff+0x160/0x210 mm/util.c:520 ksys_mmap_pgoff+0x2df/0x490 mm/mmap.c:1458 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888075431500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888075431580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888075431600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888075431680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888075431700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: 00 00 add %al,(%rax) 4: 00 fc add %bh,%ah 6: ff (bad) 7: df 48 c1 fisttps -0x3f(%rax) a: ea (bad) b: 03 80 3c 02 00 75 add 0x7500023c(%rax),%eax 11: 65 48 8b 45 00 mov %gs:0x0(%rbp),%rax 16: a8 08 test $0x8,%al 18: 75 c9 jne 0xffffffe3 1a: e8 26 8f b4 f8 callq 0xf8b48f45 1f: 66 90 xchg %ax,%ax 21: 0f 00 2d dd 37 ce 00 verw 0xce37dd(%rip) # 0xce3805 28: fb sti 29: f4 hlt * 2a: 9c pushfq <-- trapping instruction 2b: 58 pop %rax 2c: fa cli 2d: f6 c4 02 test $0x2,%ah 30: 74 b1 je 0xffffffe3 32: 5d pop %rbp 33: e9 bd 8d b4 f8 jmpq 0xf8b48df5 38: 48 89 ef mov %rbp,%rdi 3b: 5d pop %rbp 3c: e9 .byte 0xe9 3d: c4 .byte 0xc4 3e: f2 repnz 3f: ff .byte 0xff