powermate: config urb returned -71 ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3c2f/0x5470 kernel/locking/lockdep.c:4897 Read of size 8 at addr ffff88807a062058 by task kworker/0:1/20851 CPU: 0 PID: 20851 Comm: kworker/0:1 Not tainted 5.16.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x2ed mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:450 __lock_acquire+0x3c2f/0x5470 kernel/locking/lockdep.c:4897 lock_acquire kernel/locking/lockdep.c:5637 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5602 __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+0x79/0xb0 drivers/input/misc/powermate.c:202 __usb_hcd_giveback_urb+0x2b0/0x5c0 drivers/usb/core/hcd.c:1656 usb_hcd_giveback_urb+0x367/0x410 drivers/usb/core/hcd.c:1726 dummy_timer+0x11f9/0x32b0 drivers/usb/gadget/udc/dummy_hcd.c:1987 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers.part.0+0x67c/0xa30 kernel/time/timer.c:1734 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:preempt_count arch/x86/include/asm/preempt.h:27 [inline] RIP: 0010:check_kcov_mode kernel/kcov.c:166 [inline] RIP: 0010:__sanitizer_cov_trace_pc+0x0/0x60 kernel/kcov.c:200 Code: 48 89 ef 5d e9 d1 c0 45 00 5d be 03 00 00 00 e9 f6 35 64 02 66 0f 1f 44 00 00 48 8b be b0 01 00 00 e8 b4 ff ff ff 31 c0 c3 90 <65> 8b 05 f9 a7 8b 7e 89 c1 48 8b 34 24 81 e1 00 01 00 00 65 48 8b RSP: 0018:ffffc9000bdc75b8 EFLAGS: 00000216 RAX: 0000000000002bb9 RBX: 0000000000000000 RCX: ffffc9000f0f5000 RDX: 0000000000040000 RSI: ffffffff815e03dc RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff8ff7aa07 R10: ffffffff815e03d2 R11: 0000000000000000 R12: ffffffff84d44110 R13: 0000000000000200 R14: ffffc9000bdc7618 R15: dffffc0000000000 console_unlock+0x6c2/0xb70 kernel/printk/printk.c:2716 vprintk_emit+0x198/0x4f0 kernel/printk/printk.c:2245 dev_vprintk_emit+0x36e/0x3b2 drivers/base/core.c:4594 dev_printk_emit+0xba/0xf1 drivers/base/core.c:4605 __dev_printk+0xcf/0xf5 drivers/base/core.c:4617 _dev_info+0xd7/0x109 drivers/base/core.c:4663 usb_disconnect.cold+0x25/0x78e drivers/usb/core/hub.c:2207 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:5643 [inline] hub_event+0x1c9c/0x4460 drivers/usb/core/hub.c:5725 process_one_work+0x9b2/0x1660 kernel/workqueue.c:2298 worker_thread+0x65d/0x1130 kernel/workqueue.c:2445 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 14236: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:269 [inline] kmem_cache_alloc_trace+0x1ea/0x4a0 mm/slab.c:3575 kmalloc include/linux/slab.h:590 [inline] kzalloc include/linux/slab.h:724 [inline] set_kthread_struct kernel/kthread.c:103 [inline] set_kthread_struct+0xc8/0x130 kernel/kthread.c:96 kthread+0x69/0x4f0 kernel/kthread.c:282 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Last potentially related work creation: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 __kasan_record_aux_stack+0xb5/0xe0 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3550 drop_sysctl_table+0x3c0/0x4e0 fs/proc/proc_sysctl.c:1647 unregister_sysctl_table fs/proc/proc_sysctl.c:1685 [inline] unregister_sysctl_table+0xc0/0x190 fs/proc/proc_sysctl.c:1660 neigh_sysctl_unregister+0x5b/0x80 net/core/neighbour.c:3810 addrconf_notify+0x7fd/0x1bb0 net/ipv6/addrconf.c:3657 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2002 call_netdevice_notifiers_extack net/core/dev.c:2014 [inline] call_netdevice_notifiers net/core/dev.c:2028 [inline] dev_change_name+0x517/0x7b0 net/core/dev.c:1285 do_setlink+0x2bba/0x3970 net/core/rtnetlink.c:2699 __rtnl_newlink+0xde6/0x1750 net/core/rtnetlink.c:3391 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3506 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5571 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2496 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x904/0xdf0 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:724 __sys_sendto+0x21c/0x320 net/socket.c:2036 __do_sys_sendto net/socket.c:2048 [inline] __se_sys_sendto net/socket.c:2044 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2044 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+0x44/0xae The buggy address belongs to the object at ffff88807a062000 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 88 bytes inside of 256-byte region [ffff88807a062000, ffff88807a062100) The buggy address belongs to the page: page:ffffea0001e81880 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807a062000 pfn:0x7a062 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001d1a688 ffffea0001de6b48 ffff888010c40500 raw: ffff88807a062000 ffff88807a062000 0000000100000007 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 3679, ts 160882007836, free_ts 160860031482 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4149 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5369 __alloc_pages_node include/linux/gfp.h:570 [inline] kmem_getpages mm/slab.c:1377 [inline] cache_grow_begin+0x75/0x470 mm/slab.c:2593 cache_alloc_refill+0x27f/0x380 mm/slab.c:2965 ____cache_alloc mm/slab.c:3048 [inline] ____cache_alloc mm/slab.c:3031 [inline] __do_cache_alloc mm/slab.c:3275 [inline] slab_alloc mm/slab.c:3316 [inline] kmem_cache_alloc_trace+0x380/0x4a0 mm/slab.c:3573 kmalloc include/linux/slab.h:590 [inline] kzalloc include/linux/slab.h:724 [inline] set_kthread_struct kernel/kthread.c:103 [inline] set_kthread_struct+0xc8/0x130 kernel/kthread.c:96 kthread+0x69/0x4f0 kernel/kthread.c:282 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3309 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3388 slab_destroy mm/slab.c:1627 [inline] slabs_destroy+0x89/0xc0 mm/slab.c:1647 cache_flusharray mm/slab.c:3418 [inline] ___cache_free+0x4cc/0x610 mm/slab.c:3480 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x4e/0x110 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 ____kasan_kmalloc mm/kasan/common.c:479 [inline] __kasan_kmalloc+0xba/0xd0 mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:269 [inline] kmem_cache_alloc_trace+0x1ea/0x4a0 mm/slab.c:3575 kmalloc include/linux/slab.h:590 [inline] netdevice_queue_work drivers/infiniband/core/roce_gid_mgmt.c:643 [inline] netdevice_event+0x1a8/0x8a0 drivers/infiniband/core/roce_gid_mgmt.c:802 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2002 call_netdevice_notifiers_extack net/core/dev.c:2014 [inline] call_netdevice_notifiers net/core/dev.c:2028 [inline] register_netdevice+0x1073/0x1500 net/core/dev.c:10367 macsec_newlink+0x424/0x1780 drivers/net/macsec.c:4033 __rtnl_newlink+0x106d/0x1750 net/core/rtnetlink.c:3458 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3506 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5571 Memory state around the buggy address: ffff88807a061f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807a061f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807a062000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807a062080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807a062100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: 48 89 ef mov %rbp,%rdi 3: 5d pop %rbp 4: e9 d1 c0 45 00 jmpq 0x45c0da 9: 5d pop %rbp a: be 03 00 00 00 mov $0x3,%esi f: e9 f6 35 64 02 jmpq 0x264360a 14: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 1a: 48 8b be b0 01 00 00 mov 0x1b0(%rsi),%rdi 21: e8 b4 ff ff ff callq 0xffffffda 26: 31 c0 xor %eax,%eax 28: c3 retq 29: 90 nop * 2a: 65 8b 05 f9 a7 8b 7e mov %gs:0x7e8ba7f9(%rip),%eax # 0x7e8ba82a <-- trapping instruction 31: 89 c1 mov %eax,%ecx 33: 48 8b 34 24 mov (%rsp),%rsi 37: 81 e1 00 01 00 00 and $0x100,%ecx 3d: 65 gs 3e: 48 rex.W 3f: 8b .byte 0x8b