powermate: config urb returned -108
==================================================================
BUG: KASAN: use-after-free in trace_event_get_offsets_lock_acquire include/trace/events/lock.h:13 [inline]
BUG: KASAN: use-after-free in perf_trace_lock_acquire+0xf8/0x4a0 include/trace/events/lock.h:13
Read of size 8 at addr ffff888075c85a70 by task syz-executor.1/1382
CPU: 1 PID: 1382 Comm: syz-executor.1 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+0x1dc/0x2d8 lib/dump_stack.c:106
print_address_description+0x65/0x380 mm/kasan/report.c:247
__kasan_report mm/kasan/report.c:433 [inline]
kasan_report+0x19a/0x1f0 mm/kasan/report.c:450
trace_event_get_offsets_lock_acquire include/trace/events/lock.h:13 [inline]
perf_trace_lock_acquire+0xf8/0x4a0 include/trace/events/lock.h:13
trace_lock_acquire+0x161/0x190 include/trace/events/lock.h:13
lock_acquire+0xa5/0x4d0 kernel/locking/lockdep.c:5608
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
powermate_config_complete+0x6b/0xc0 drivers/input/misc/powermate.c:202
__usb_hcd_giveback_urb+0x375/0x520 drivers/usb/core/hcd.c:1656
dummy_timer+0x808/0x3150 drivers/usb/gadget/udc/dummy_hcd.c:1987
call_timer_fn+0xf6/0x210 kernel/time/timer.c:1421
expire_timers kernel/time/timer.c:1466 [inline]
__run_timers+0x71a/0x910 kernel/time/timer.c:1734
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1747
__do_softirq+0x392/0x7a3 kernel/softirq.c:558
__irq_exit_rcu+0xec/0x170 kernel/softirq.c:637
irq_exit_rcu+0x5/0x20 kernel/softirq.c:649
sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1097
asm_sysvec_apic_timer_interrupt+0x12/0x20
RIP: 0010:lock_acquire+0x21f/0x4d0 kernel/locking/lockdep.c:5641
Code: 08 4c 89 f7 e8 a2 ff 68 00 f6 84 24 81 00 00 00 02 0f 85 13 02 00 00 41 f7 c4 00 02 00 00 74 01 fb 48 c7 44 24 40 0e 36 e0 45 <4b> c7 04 2f 00 00 00 00 43 c7 44 2f 09 00 00 00 00 43 c7 44 2f 11
RSP: 0018:ffffc9000463f820 EFLAGS: 00000206
RAX: 0000000000000001 RBX: 1ffff920008c7f14 RCX: ffff88801900a758
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc9000463f978 R08: dffffc0000000000 R09: fffffbfff1ff3ddd
R10: fffffbfff1ff3ddd R11: 0000000000000000 R12: 0000000000000246
R13: 1ffff920008c7f0c R14: ffffc9000463f8a0 R15: dffffc0000000000
rcu_lock_acquire+0x20/0x30 include/linux/rcupdate.h:268
rcu_read_lock include/linux/rcupdate.h:688 [inline]
percpu_ref_tryget_many include/linux/percpu-refcount.h:241 [inline]
percpu_ref_tryget+0x17/0x140 include/linux/percpu-refcount.h:266
css_tryget include/linux/cgroup.h:354 [inline]
get_mem_cgroup_from_objcg+0xa1/0x120 mm/memcontrol.c:2751
obj_cgroup_uncharge_pages mm/memcontrol.c:2980 [inline]
__memcg_kmem_uncharge_page+0xc9/0x1b0 mm/memcontrol.c:3058
memcg_kmem_uncharge_page include/linux/memcontrol.h:1728 [inline]
free_thread_stack kernel/fork.c:281 [inline]
release_task_stack+0xe9/0x260 kernel/fork.c:431
put_task_stack kernel/fork.c:442 [inline]
copy_process+0x1a89/0x5ca0 kernel/fork.c:2471
kernel_clone+0x22a/0x7e0 kernel/fork.c:2582
__do_sys_clone kernel/fork.c:2699 [inline]
__se_sys_clone kernel/fork.c:2683 [inline]
__x64_sys_clone+0x245/0x2b0 kernel/fork.c:2683
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7ffaf50942c1
Code: 48 85 ff 74 3d 48 85 f6 74 38 48 83 ee 10 48 89 4e 08 48 89 3e 48 89 d7 4c 89 c2 4d 89 c8 4c 8b 54 24 08 b8 38 00 00 00 0f 05 <48> 85 c0 7c 13 74 01 c3 31 ed 58 5f ff d0 48 89 c7 b8 3c 00 00 00
RSP: 002b:00007fff20bdfed8 EFLAGS: 00000206 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 00007ffaf39e7700 RCX: 00007ffaf50942c1
RDX: 00007ffaf39e79d0 RSI: 00007ffaf39e72f0 RDI: 00000000003d0f00
RBP: 00007fff20be0120 R08: 00007ffaf39e7700 R09: 00007ffaf39e7700
R10: 00007ffaf39e79d0 R11: 0000000000000206 R12: 00007fff20bdff8e
R13: 00007fff20bdff8f R14: 00007ffaf39e7300 R15: 0000555556e3d940
Allocated by task 3667:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:513
kasan_kmalloc include/linux/kasan.h:269 [inline]
kmem_cache_alloc_trace+0x9d/0x330 mm/slub.c:3261
kmalloc include/linux/slab.h:590 [inline]
kzalloc include/linux/slab.h:724 [inline]
powermate_probe+0x1eb/0x15f0 drivers/input/misc/powermate.c:323
usb_probe_interface+0x633/0xb40 drivers/usb/core/driver.c:396
call_driver_probe+0x96/0x250
really_probe+0x223/0x9b0 drivers/base/dd.c:596
__driver_probe_device+0x1f8/0x3e0 drivers/base/dd.c:751
driver_probe_device+0x50/0x240 drivers/base/dd.c:781
__device_attach_driver+0x1e1/0x3b0 drivers/base/dd.c:898
bus_for_each_drv+0x18a/0x210 drivers/base/bus.c:427
__device_attach+0x310/0x560 drivers/base/dd.c:969
bus_probe_device+0xb8/0x1f0 drivers/base/bus.c:487
device_add+0x11c8/0x16d0 drivers/base/core.c:3394
usb_set_configuration+0x1a86/0x2100 drivers/usb/core/message.c:2170
usb_generic_driver_probe+0x83/0x140 drivers/usb/core/generic.c:238
usb_probe_device+0x13a/0x260 drivers/usb/core/driver.c:293
call_driver_probe+0x96/0x250
really_probe+0x223/0x9b0 drivers/base/dd.c:596
__driver_probe_device+0x1f8/0x3e0 drivers/base/dd.c:751
driver_probe_device+0x50/0x240 drivers/base/dd.c:781
__device_attach_driver+0x1e1/0x3b0 drivers/base/dd.c:898
bus_for_each_drv+0x18a/0x210 drivers/base/bus.c:427
__device_attach+0x310/0x560 drivers/base/dd.c:969
bus_probe_device+0xb8/0x1f0 drivers/base/bus.c:487
device_add+0x11c8/0x16d0 drivers/base/core.c:3394
usb_new_device+0x108a/0x1940 drivers/usb/core/hub.c:2563
hub_port_connect+0x100b/0x2910 drivers/usb/core/hub.c:5353
hub_port_connect_change+0x5f9/0xc20 drivers/usb/core/hub.c:5497
port_event+0xb67/0x1220 drivers/usb/core/hub.c:5643
hub_event+0x4ed/0xe40 drivers/usb/core/hub.c:5725
process_one_work+0x853/0x1140 kernel/workqueue.c:2298
worker_thread+0xac1/0x1320 kernel/workqueue.c:2445
kthread+0x468/0x490 kernel/kthread.c:327
ret_from_fork+0x1f/0x30
Freed by task 1385:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370
____kasan_slab_free+0x10d/0x150 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:1723 [inline]
slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1749
slab_free mm/slub.c:3513 [inline]
kfree+0xe1/0x330 mm/slub.c:4561
usb_unbind_interface+0x1f2/0x860 drivers/usb/core/driver.c:458
__device_release_driver drivers/base/dd.c:1205 [inline]
device_release_driver_internal+0x523/0x7b0 drivers/base/dd.c:1236
bus_remove_device+0x2fd/0x410 drivers/base/bus.c:529
device_del+0x6f1/0xbf0 drivers/base/core.c:3581
usb_disable_device+0x407/0x800 drivers/usb/core/message.c:1419
usb_disconnect+0x33a/0x8a0 drivers/usb/core/hub.c:2225
hub_quiesce+0x185/0x330 drivers/usb/core/hub.c:1327
hub_disconnect+0xce/0x480 drivers/usb/core/hub.c:1722
usb_unbind_interface+0x1f2/0x860 drivers/usb/core/driver.c:458
__device_release_driver drivers/base/dd.c:1205 [inline]
device_release_driver_internal+0x523/0x7b0 drivers/base/dd.c:1236
proc_disconnect_claim+0x2f1/0x3c0 drivers/usb/core/devio.c:2464
usbdev_do_ioctl drivers/usb/core/devio.c:2747 [inline]
usbdev_ioctl+0x14b6/0x6d00 drivers/usb/core/devio.c:2791
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xfb/0x170 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
Last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38
__kasan_record_aux_stack+0xfa/0x130 mm/kasan/generic.c:348
kvfree_call_rcu+0x119/0x880 kernel/rcu/tree.c:3550
drop_sysctl_table+0x2cd/0x400 fs/proc/proc_sysctl.c:1647
drop_sysctl_table+0x2eb/0x400 fs/proc/proc_sysctl.c:1650
unregister_sysctl_table+0x86/0x130 fs/proc/proc_sysctl.c:1685
neigh_sysctl_unregister+0x74/0x90 net/core/neighbour.c:3810
devinet_sysctl_unregister net/ipv4/devinet.c:2633 [inline]
inetdev_destroy net/ipv4/devinet.c:326 [inline]
inetdev_event+0x774/0x1410 net/ipv4/devinet.c:1600
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:391
call_netdevice_notifiers_info net/core/dev.c:2002 [inline]
call_netdevice_notifiers_extack net/core/dev.c:2014 [inline]
call_netdevice_notifiers net/core/dev.c:2028 [inline]
unregister_netdevice_many+0xfae/0x19e0 net/core/dev.c:11080
sit_exit_batch_net+0x495/0x4e0 net/ipv6/sit.c:1950
ops_exit_list net/core/net_namespace.c:171 [inline]
cleanup_net+0x7ec/0xc50 net/core/net_namespace.c:593
process_one_work+0x853/0x1140 kernel/workqueue.c:2298
worker_thread+0xac1/0x1320 kernel/workqueue.c:2445
kthread+0x468/0x490 kernel/kthread.c:327
ret_from_fork+0x1f/0x30
Second to last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38
__kasan_record_aux_stack+0xfa/0x130 mm/kasan/generic.c:348
__call_rcu kernel/rcu/tree.c:2985 [inline]
call_rcu+0x1c4/0xa70 kernel/rcu/tree.c:3065
fib6_info_release include/net/ip6_fib.h:337 [inline]
ip6_route_info_create+0xd2d/0x1a50 net/ipv6/route.c:3853
ip6_route_add+0x22/0x120 net/ipv6/route.c:3867
addrconf_add_mroute net/ipv6/addrconf.c:2488 [inline]
addrconf_add_dev+0x43c/0x620 net/ipv6/addrconf.c:2506
inet6_addr_add+0x218/0x1250 net/ipv6/addrconf.c:2922
inet6_rtm_newaddr+0x83d/0x2a90 net/ipv6/addrconf.c:4892
rtnetlink_rcv_msg+0x934/0xe60 net/core/rtnetlink.c:5571
netlink_rcv_skb+0x200/0x470 net/netlink/af_netlink.c:2496
netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
netlink_unicast+0x814/0x9f0 net/netlink/af_netlink.c:1345
netlink_sendmsg+0xaea/0xe60 net/netlink/af_netlink.c:1921
sock_sendmsg_nosec net/socket.c:704 [inline]
sock_sendmsg net/socket.c:724 [inline]
__sys_sendto+0x42e/0x5b0 net/socket.c:2036
__do_sys_sendto net/socket.c:2048 [inline]
__se_sys_sendto net/socket.c:2044 [inline]
__x64_sys_sendto+0xda/0xf0 net/socket.c:2044
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
The buggy address belongs to the object at ffff888075c85a00
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 112 bytes inside of
256-byte region [ffff888075c85a00, ffff888075c85b00)
The buggy address belongs to the page:
page:ffffea0001d72100 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x75c84
head:ffffea0001d72100 order:1 compound_mapcount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea00006ad080 dead000000000004 ffff888011441b40
raw: 0000000000000000 0000000000100010 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 0x52a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 25, ts 60475098505, free_ts 19537972996
prep_new_page mm/page_alloc.c:2418 [inline]
get_page_from_freelist+0x729/0x9e0 mm/page_alloc.c:4149
__alloc_pages+0x255/0x580 mm/page_alloc.c:5369
alloc_slab_page mm/slub.c:1793 [inline]
allocate_slab+0xcc/0x540 mm/slub.c:1930
new_slab mm/slub.c:1993 [inline]
___slab_alloc+0x41e/0xc40 mm/slub.c:3022
__slab_alloc mm/slub.c:3109 [inline]
slab_alloc_node mm/slub.c:3200 [inline]
slab_alloc mm/slub.c:3242 [inline]
__kmalloc+0x2eb/0x380 mm/slub.c:4419
kmalloc include/linux/slab.h:595 [inline]
kzalloc include/linux/slab.h:724 [inline]
fib6_info_alloc+0x2c/0xd0 net/ipv6/ip6_fib.c:155
ip6_route_info_create+0x507/0x1a50 net/ipv6/route.c:3773
ip6_route_add+0x22/0x120 net/ipv6/route.c:3867
addrconf_prefix_route net/ipv6/addrconf.c:2424 [inline]
addrconf_add_linklocal+0x6ef/0xb00 net/ipv6/addrconf.c:3199
addrconf_addr_gen+0x34c/0xdb0
addrconf_notify+0x17f4/0x2130 net/ipv6/addrconf.c:3613
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:391
call_netdevice_notifiers_info net/core/dev.c:2002 [inline]
netdev_state_change+0x1aa/0x270 net/core/dev.c:1393
linkwatch_do_dev+0x10a/0x160 net/core/link_watch.c:167
__linkwatch_run_queue+0x4f5/0x800 net/core/link_watch.c:213
linkwatch_event+0x48/0x50 net/core/link_watch.c:252
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+0xd1c/0xe00 mm/page_alloc.c:1389
free_unref_page_prepare mm/page_alloc.c:3309 [inline]
free_unref_page+0x7d/0x580 mm/page_alloc.c:3388
free_slab mm/slub.c:2033 [inline]
discard_slab mm/slub.c:2039 [inline]
__unfreeze_partials+0x1ab/0x200 mm/slub.c:2527
put_cpu_partial+0x116/0x180 mm/slub.c:2603
do_slab_free mm/slub.c:3501 [inline]
___cache_free+0xe6/0x120 mm/slub.c:3520
qlist_free_all mm/kasan/quarantine.c:165 [inline]
kasan_quarantine_reduce+0x151/0x1c0 mm/kasan/quarantine.c:272
__kasan_slab_alloc+0x2f/0xf0 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/slub.c:3234 [inline]
kmem_cache_alloc_node+0x201/0x370 mm/slub.c:3270
__alloc_skb+0xd8/0x5a0 net/core/skbuff.c:414
alloc_skb include/linux/skbuff.h:1127 [inline]
alloc_skb_with_frags+0xab/0x660 net/core/skbuff.c:6078
sock_alloc_send_pskb+0x928/0xa60 net/core/sock.c:2575
unix_dgram_sendmsg+0x816/0x2a50 net/unix/af_unix.c:1811
sock_sendmsg_nosec net/socket.c:704 [inline]
sock_sendmsg net/socket.c:724 [inline]
sock_write_iter+0x37c/0x4e0 net/socket.c:1057
call_write_iter include/linux/fs.h:2162 [inline]
new_sync_write fs/read_write.c:503 [inline]
vfs_write+0xb11/0xe90 fs/read_write.c:590
ksys_write+0x18f/0x2c0 fs/read_write.c:643
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
Memory state around the buggy address:
ffff888075c85900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888075c85980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888075c85a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888075c85a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888075c85b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
----------------
Code disassembly (best guess):
0: 08 4c 89 f7 or %cl,-0x9(%rcx,%rcx,4)
4: e8 a2 ff 68 00 callq 0x68ffab
9: f6 84 24 81 00 00 00 testb $0x2,0x81(%rsp)
10: 02
11: 0f 85 13 02 00 00 jne 0x22a
17: 41 f7 c4 00 02 00 00 test $0x200,%r12d
1e: 74 01 je 0x21
20: fb sti
21: 48 c7 44 24 40 0e 36 movq $0x45e0360e,0x40(%rsp)
28: e0 45
* 2a: 4b c7 04 2f 00 00 00 movq $0x0,(%r15,%r13,1) <-- trapping instruction
31: 00
32: 43 c7 44 2f 09 00 00 movl $0x0,0x9(%r15,%r13,1)
39: 00 00
3b: 43 rex.XB
3c: c7 .byte 0xc7
3d: 44 2f rex.R (bad)
3f: 11 .byte 0x11