powermate: config urb returned -108
==================================================================
BUG: KASAN: use-after-free in perf_trace_lock_acquire+0x400/0x550 include/trace/events/lock.h:13
Read of size 8 at addr ffff88801f828c70 by task syz-executor.4/23055
CPU: 0 PID: 23055 Comm: syz-executor.4 Not tainted 5.16.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
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
perf_trace_lock_acquire+0x400/0x550 include/trace/events/lock.h:13
trace_lock_acquire include/trace/events/lock.h:13 [inline]
lock_acquire+0x416/0x510 kernel/locking/lockdep.c:5608
__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:lockdep_enabled kernel/locking/lockdep.c:91 [inline]
RIP: 0010:lock_release+0x10f/0x720 kernel/locking/lockdep.c:5650
Code: 35 0c 45 85 d2 0f 84 f7 02 00 00 65 8b 05 f9 9d a6 7e 85 c0 0f 85 e8 02 00 00 65 4c 8b 34 25 40 70 02 00 49 8d be 5c 0a 00 00 <48> b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 0f b6 14 02 48
RSP: 0018:ffffc9000a0ef930 EFLAGS: 00000246
RAX: 0000000000000000 RBX: ffffffff8d914fac RCX: 0000000000000001
RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffff888073386a9c
RBP: 1ffff9200141df28 R08: 0000000000000000 R09: ffffffff8d911b97
R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff8bb812a0
R13: ffff88801ddcdcb0 R14: ffff888073386040 R15: 00007fc437597000
zap_pte_range mm/memory.c:1357 [inline]
zap_pmd_range mm/memory.c:1467 [inline]
zap_pud_range mm/memory.c:1496 [inline]
zap_p4d_range mm/memory.c:1517 [inline]
unmap_page_range+0xf0e/0x29f0 mm/memory.c:1538
unmap_single_vma+0x198/0x310 mm/memory.c:1583
unmap_vmas+0x16b/0x2f0 mm/memory.c:1615
exit_mmap+0x1d0/0x630 mm/mmap.c:3170
__mmput+0x122/0x4b0 kernel/fork.c:1113
mmput+0x56/0x60 kernel/fork.c:1134
exit_mm kernel/exit.c:507 [inline]
do_exit+0xb27/0x2b40 kernel/exit.c:819
do_group_exit+0x125/0x310 kernel/exit.c:929
__do_sys_exit_group kernel/exit.c:940 [inline]
__se_sys_exit_group kernel/exit.c:938 [inline]
__x64_sys_exit_group+0x3a/0x50 kernel/exit.c:938
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
RIP: 0033:0x7fc43773ee99
Code: Unable to access opcode bytes at RIP 0x7fc43773ee6f.
RSP: 002b:00007fff5ef6ce28 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 000000000000001e RCX: 00007fc43773ee99
RDX: 00007fc4376f1adb RSI: ffffffffffffffbc RDI: 0000000000000000
RBP: 0000000000000001 R08: 00000000803ee021 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 0000000000000000 R14: 0000000000000001 R15: 00007fff5ef6cf10
Allocated by task 3689:
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]
powermate_probe+0x24a/0x12a0 drivers/input/misc/powermate.c:323
usb_probe_interface+0x315/0x7f0 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:517 [inline]
really_probe+0x245/0xcc0 drivers/base/dd.c:596
__driver_probe_device+0x338/0x4d0 drivers/base/dd.c:751
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:781
__device_attach_driver+0x20b/0x2f0 drivers/base/dd.c:898
bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:427
__device_attach+0x228/0x4a0 drivers/base/dd.c:969
bus_probe_device+0x1e4/0x290 drivers/base/bus.c:487
device_add+0xc17/0x1ee0 drivers/base/core.c:3394
usb_set_configuration+0x101e/0x1900 drivers/usb/core/message.c:2170
usb_generic_driver_probe+0xba/0x100 drivers/usb/core/generic.c:238
usb_probe_device+0xd9/0x2c0 drivers/usb/core/driver.c:293
call_driver_probe drivers/base/dd.c:517 [inline]
really_probe+0x245/0xcc0 drivers/base/dd.c:596
__driver_probe_device+0x338/0x4d0 drivers/base/dd.c:751
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:781
__device_attach_driver+0x20b/0x2f0 drivers/base/dd.c:898
bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:427
__device_attach+0x228/0x4a0 drivers/base/dd.c:969
bus_probe_device+0x1e4/0x290 drivers/base/bus.c:487
device_add+0xc17/0x1ee0 drivers/base/core.c:3394
usb_new_device.cold+0x63f/0x108e drivers/usb/core/hub.c:2563
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:5643 [inline]
hub_event+0x23e5/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
Freed by task 23054:
kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38
kasan_set_track+0x21/0x30 mm/kasan/common.c:46
kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370
____kasan_slab_free mm/kasan/common.c:366 [inline]
____kasan_slab_free mm/kasan/common.c:328 [inline]
__kasan_slab_free+0xd1/0x110 mm/kasan/common.c:374
kasan_slab_free include/linux/kasan.h:235 [inline]
__cache_free mm/slab.c:3445 [inline]
kfree+0x10d/0x2c0 mm/slab.c:3802
powermate_disconnect+0x1ce/0x250 drivers/input/misc/powermate.c:432
usb_unbind_interface+0x1d8/0x8e0 drivers/usb/core/driver.c:458
__device_release_driver+0x5d7/0x700 drivers/base/dd.c:1205
device_release_driver_internal drivers/base/dd.c:1236 [inline]
device_release_driver+0x26/0x40 drivers/base/dd.c:1259
bus_remove_device+0x2eb/0x5a0 drivers/base/bus.c:529
device_del+0x502/0xd60 drivers/base/core.c:3581
usb_disable_device+0x35b/0x7b0 drivers/usb/core/message.c:1419
usb_disconnect.cold+0x27a/0x78e drivers/usb/core/hub.c:2225
hub_quiesce+0x170/0x310 drivers/usb/core/hub.c:1327
hub_disconnect+0xcb/0x510 drivers/usb/core/hub.c:1722
usb_unbind_interface+0x1d8/0x8e0 drivers/usb/core/driver.c:458
__device_release_driver+0x5d7/0x700 drivers/base/dd.c:1205
device_release_driver_internal drivers/base/dd.c:1236 [inline]
device_release_driver+0x26/0x40 drivers/base/dd.c:1259
usb_driver_release_interface+0x102/0x180 drivers/usb/core/driver.c:627
proc_disconnect_claim+0x217/0x380 drivers/usb/core/devio.c:2464
usbdev_do_ioctl drivers/usb/core/devio.c:2747 [inline]
usbdev_ioctl+0x2b43/0x36c0 drivers/usb/core/devio.c:2791
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl fs/ioctl.c:860 [inline]
__x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860
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
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
__call_rcu kernel/rcu/tree.c:2985 [inline]
call_rcu+0xb1/0x740 kernel/rcu/tree.c:3065
fib6_info_release include/net/ip6_fib.h:337 [inline]
fib6_info_release include/net/ip6_fib.h:334 [inline]
ip6_route_add+0x12d/0x150 net/ipv6/route.c:3872
addrconf_prefix_route+0x30a/0x4e0 net/ipv6/addrconf.c:2424
add_v4_addrs+0x649/0x880 net/ipv6/addrconf.c:3152
addrconf_gre_config net/ipv6/addrconf.c:3425 [inline]
addrconf_notify+0x9b7/0x1bb0 net/ipv6/addrconf.c:3605
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_notify_flags+0x110/0x2b0 net/core/dev.c:8834
dev_change_flags+0x112/0x170 net/core/dev.c:8872
do_setlink+0x96d/0x3970 net/core/rtnetlink.c:2719
__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
Second to 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
__call_rcu kernel/rcu/tree.c:2985 [inline]
call_rcu+0xb1/0x740 kernel/rcu/tree.c:3065
fib6_info_release include/net/ip6_fib.h:337 [inline]
fib6_info_release include/net/ip6_fib.h:334 [inline]
fib6_del_route net/ipv6/ip6_fib.c:1994 [inline]
fib6_del+0x11d7/0x15d0 net/ipv6/ip6_fib.c:2027
fib6_clean_node+0x393/0x5c0 net/ipv6/ip6_fib.c:2189
fib6_walk_continue+0x3e9/0x6c0 net/ipv6/ip6_fib.c:2111
fib6_walk+0x182/0x370 net/ipv6/ip6_fib.c:2159
fib6_clean_tree+0xdb/0x120 net/ipv6/ip6_fib.c:2239
__fib6_clean_all+0x107/0x2a0 net/ipv6/ip6_fib.c:2255
rt6_sync_down_dev net/ipv6/route.c:4907 [inline]
rt6_disable_ip+0x844/0x940 net/ipv6/route.c:4912
addrconf_ifdown.isra.0+0xf6/0x1630 net/ipv6/addrconf.c:3726
addrconf_notify+0xeb/0x1bb0 net/ipv6/addrconf.c:3651
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_close_many+0x2ff/0x620 net/core/dev.c:1603
unregister_netdevice_many+0x3ff/0x1790 net/core/dev.c:11057
default_device_exit_batch+0x2fa/0x3c0 net/core/dev.c:11610
ops_exit_list+0x10d/0x160 net/core/net_namespace.c:171
cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:593
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
The buggy address belongs to the object at ffff88801f828c00
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 112 bytes inside of
256-byte region [ffff88801f828c00, ffff88801f828d00)
The buggy address belongs to the page:
page:ffffea00007e0a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1f828
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea0001d7be08 ffffea0001fee148 ffff888010c40500
raw: 0000000000000000 ffff88801f828000 0000000100000008 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 3641, ts 140930469297, free_ts 140843966328
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]
fib6_info_alloc+0xc1/0x210 net/ipv6/ip6_fib.c:155
ip6_route_info_create+0x33e/0x1aa0 net/ipv6/route.c:3773
ip6_route_add+0x24/0x150 net/ipv6/route.c:3867
addrconf_add_mroute+0x1e1/0x310 net/ipv6/addrconf.c:2488
addrconf_add_dev+0x162/0x1d0 net/ipv6/addrconf.c:2506
inet6_addr_add+0x1a4/0xae0 net/ipv6/addrconf.c:2922
inet6_rtm_newaddr+0xf00/0x1970 net/ipv6/addrconf.c:4892
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
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_slab_alloc+0x97/0xb0 mm/kasan/common.c:444
kasan_slab_alloc include/linux/kasan.h:259 [inline]
slab_post_alloc_hook mm/slab.h:519 [inline]
slab_alloc_node mm/slab.c:3261 [inline]
kmem_cache_alloc_node+0x2ea/0x590 mm/slab.c:3599
__alloc_skb+0x215/0x340 net/core/skbuff.c:414
alloc_skb include/linux/skbuff.h:1127 [inline]
nlmsg_new include/net/netlink.h:953 [inline]
netlink_ack+0x1f0/0xa60 net/netlink/af_netlink.c:2431
netlink_rcv_skb+0x33d/0x420 net/netlink/af_netlink.c:2502
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
Memory state around the buggy address:
ffff88801f828b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88801f828b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88801f828c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88801f828c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88801f828d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
----------------
Code disassembly (best guess):
0: 35 0c 45 85 d2 xor $0xd285450c,%eax
5: 0f 84 f7 02 00 00 je 0x302
b: 65 8b 05 f9 9d a6 7e mov %gs:0x7ea69df9(%rip),%eax # 0x7ea69e0b
12: 85 c0 test %eax,%eax
14: 0f 85 e8 02 00 00 jne 0x302
1a: 65 4c 8b 34 25 40 70 mov %gs:0x27040,%r14
21: 02 00
23: 49 8d be 5c 0a 00 00 lea 0xa5c(%r14),%rdi
* 2a: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax <-- trapping instruction
31: fc ff df
34: 48 89 fa mov %rdi,%rdx
37: 48 c1 ea 03 shr $0x3,%rdx
3b: 0f b6 14 02 movzbl (%rdx,%rax,1),%edx
3f: 48 rex.W