xpad 6-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19
xpad 6-1:179.65: xpad_irq_out - usb_submit_urb failed with result -19
==================================================================
BUG: KASAN: slab-use-after-free in register_lock_class+0x101f/0x1230 kernel/locking/lockdep.c:1332
Read of size 1 at addr ffff888015670091 by task syz.2.390/6697
CPU: 0 UID: 0 PID: 6697 Comm: syz.2.390 Not tainted 6.11.0-rc2-syzkaller #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
register_lock_class+0x101f/0x1230 kernel/locking/lockdep.c:1332
__lock_acquire+0x135/0x3cb0 kernel/locking/lockdep.c:5019
lock_acquire kernel/locking/lockdep.c:5759 [inline]
lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5724
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
__wake_up_common_lock kernel/sched/wait.c:105 [inline]
__wake_up+0x1c/0x60 kernel/sched/wait.c:127
__usb_unanchor_urb drivers/usb/core/urb.c:156 [inline]
usb_anchor_resume_wakeups+0xc2/0xe0 drivers/usb/core/urb.c:150
__usb_hcd_giveback_urb+0x3b7/0x6e0 drivers/usb/core/hcd.c:1653
usb_hcd_giveback_urb+0x396/0x450 drivers/usb/core/hcd.c:1734
dummy_timer+0x13c2/0x3500 drivers/usb/gadget/udc/dummy_hcd.c:1987
__run_hrtimer kernel/time/hrtimer.c:1689 [inline]
__hrtimer_run_queues+0x20c/0xcc0 kernel/time/hrtimer.c:1753
hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1815
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1032 [inline]
__sysvec_apic_timer_interrupt+0x10f/0x450 arch/x86/kernel/apic/apic.c:1049
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1043
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:preempt_schedule_irq+0x4c/0x90 kernel/sched/core.c:6851
Code: df 55 65 48 8b 2d a4 3a fc 74 53 48 89 eb 48 c1 eb 03 48 01 c3 bf 01 00 00 00 e8 8f fa 53 f6 e8 6a c9 8a f6 fb bf 01 00 00 00 4f a3 ff ff 9c 58 fa f6 c4 02 75 1e bf 01 00 00 00 e8 bd 9e 53
RSP: 0000:ffffc9000e88fe68 EFLAGS: 00000206
RAX: 00000000000053a5 RBX: ffffed10047da488 RCX: 1ffffffff2021ad9
RDX: 0000000000000000 RSI: ffffffff8b4ccfc0 RDI: 0000000000000001
RBP: ffff888023ed2440 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff90111b1f R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
irqentry_exit+0x36/0x90 kernel/entry/common.c:354
asm_sysvec_reschedule_ipi+0x1a/0x20 arch/x86/include/asm/idtentry.h:707
RIP: 0010:exit_to_user_mode_loop kernel/entry/common.c:101 [inline]
RIP: 0010:exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
RIP: 0010:irqentry_exit_to_user_mode+0x120/0x280 kernel/entry/common.c:231
Code: 9c 58 fa f6 c4 02 0f 85 18 01 00 00 e8 69 0e 00 00 48 8b 5d 00 f7 c3 0e 30 02 00 0f 84 2b ff ff ff e8 b4 23 8c f6 fb f6 c3 08 <75> bd f6 c7 10 74 c2 4c 89 e7 e8 01 72 b6 f6 f7 c3 04 00 02 00 74
RSP: 0000:ffffc9000e88ff38 EFLAGS: 00000202
RAX: 00000000000053a3 RBX: 0000000020000008 RCX: 1ffffffff2021ad9
RDX: 0000000000000000 RSI: ffffffff8b4ccfc0 RDI: ffffffff8bb041e0
RBP: ffff888023ed2440 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff90111b1f R11: ffff88802c128a40 R12: ffffc9000e88ff58
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
asm_sysvec_call_function_single+0x1a/0x20 arch/x86/include/asm/idtentry.h:709
RIP: 0023:0xf71cd592
Code: 8b 45 08 8b 4d 0c 83 c5 08 89 ce 39 d0 19 fe 72 ef 89 44 24 0c 8b 44 24 10 89 4c 24 10 8b 74 24 14 83 e8 08 89 f9 39 f2 19 d9 <73> 15 8d 74 26 00 8b 70 f8 8b 58 fc 83 e8 08 89 f9 39 f2 19 d9 72
RSP: 002b:00000000ffd5d2e0 EFLAGS: 00000246
RAX: 00000000f69ecdd0 RBX: 00000000ffffffff RCX: 0000000000000000
RDX: 0000000081393acc RSI: 0000000081393acc RDI: 00000000ffffffff
RBP: 00000000f69eccb0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Allocated by task 8:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387
kmalloc_noprof include/linux/slab.h:681 [inline]
kzalloc_noprof include/linux/slab.h:807 [inline]
xpad_probe+0x27e/0x1e60 drivers/input/joystick/xpad.c:2026
usb_probe_interface+0x309/0x9d0 drivers/usb/core/driver.c:399
call_driver_probe drivers/base/dd.c:578 [inline]
really_probe+0x23e/0xa90 drivers/base/dd.c:657
__driver_probe_device+0x1de/0x440 drivers/base/dd.c:799
driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:829
__device_attach_driver+0x1df/0x310 drivers/base/dd.c:957
bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:457
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1029
bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:532
device_add+0x114b/0x1a70 drivers/base/core.c:3679
usb_set_configuration+0x10ea/0x1ca0 drivers/usb/core/message.c:2210
usb_generic_driver_probe+0xb1/0x110 drivers/usb/core/generic.c:254
usb_probe_device+0xec/0x3e0 drivers/usb/core/driver.c:294
call_driver_probe drivers/base/dd.c:578 [inline]
really_probe+0x23e/0xa90 drivers/base/dd.c:657
__driver_probe_device+0x1de/0x440 drivers/base/dd.c:799
driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:829
__device_attach_driver+0x1df/0x310 drivers/base/dd.c:957
bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:457
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1029
bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:532
device_add+0x114b/0x1a70 drivers/base/core.c:3679
usb_new_device+0xd2c/0x1960 drivers/usb/core/hub.c:2651
hub_port_connect drivers/usb/core/hub.c:5521 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5661 [inline]
port_event drivers/usb/core/hub.c:5821 [inline]
hub_event+0x2db0/0x4e20 drivers/usb/core/hub.c:5903
process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231
process_scheduled_works kernel/workqueue.c:3312 [inline]
worker_thread+0x6c8/0xf20 kernel/workqueue.c:3390
kthread+0x2c1/0x3a0 kernel/kthread.c:389
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Freed by task 25:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579
poison_slab_object+0xf7/0x160 mm/kasan/common.c:240
__kasan_slab_free+0x32/0x50 mm/kasan/common.c:256
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2252 [inline]
slab_free mm/slub.c:4473 [inline]
kfree+0x12a/0x3b0 mm/slub.c:4594
xpad_disconnect+0x1cf/0x580 drivers/input/joystick/xpad.c:2207
usb_unbind_interface+0x1e8/0x970 drivers/usb/core/driver.c:461
device_remove drivers/base/dd.c:568 [inline]
device_remove+0x122/0x170 drivers/base/dd.c:560
__device_release_driver drivers/base/dd.c:1272 [inline]
device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295
bus_remove_device+0x22f/0x420 drivers/base/bus.c:574
device_del+0x396/0x9f0 drivers/base/core.c:3868
usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1418
usb_disconnect+0x2e1/0x920 drivers/usb/core/hub.c:2304
hub_port_connect drivers/usb/core/hub.c:5361 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5661 [inline]
port_event drivers/usb/core/hub.c:5821 [inline]
hub_event+0x1dbb/0x4e20 drivers/usb/core/hub.c:5903
process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231
process_scheduled_works kernel/workqueue.c:3312 [inline]
worker_thread+0x6c8/0xf20 kernel/workqueue.c:3390
kthread+0x2c1/0x3a0 kernel/kthread.c:389
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
The buggy address belongs to the object at ffff888015670000
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 145 bytes inside of
freed 1024-byte region [ffff888015670000, ffff888015670400)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x15670
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xfdffffff(slab)
raw: 00fff00000000040 ffff888015842dc0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000100010 00000001fdffffff 0000000000000000
head: 00fff00000000040 ffff888015842dc0 dead000000000100 dead000000000122
head: 0000000000000000 0000000000100010 00000001fdffffff 0000000000000000
head: 00fff00000000003 ffffea0000559c01 ffffffffffffffff 0000000000000000
head: 0000000000000008 0000000000000000 00000000ffffffff 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 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5357, tgid 5357 (syz-executor), ts 60797804255, free_ts 59797259235
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1493
prep_new_page mm/page_alloc.c:1501 [inline]
get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3442
__alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4700
__alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
alloc_slab_page+0x4e/0xf0 mm/slub.c:2321
allocate_slab mm/slub.c:2484 [inline]
new_slab+0x84/0x260 mm/slub.c:2537
___slab_alloc+0xdac/0x1870 mm/slub.c:3723
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3813
__slab_alloc_node mm/slub.c:3866 [inline]
slab_alloc_node mm/slub.c:4025 [inline]
__do_kmalloc_node mm/slub.c:4157 [inline]
__kmalloc_node_track_caller_noprof+0x365/0x440 mm/slub.c:4177
kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:605
__alloc_skb+0x164/0x380 net/core/skbuff.c:674
alloc_skb include/linux/skbuff.h:1320 [inline]
nlmsg_new include/net/netlink.h:1015 [inline]
inet6_rt_notify+0xf0/0x2c0 net/ipv6/route.c:6180
fib6_add_rt2node net/ipv6/ip6_fib.c:1266 [inline]
fib6_add+0x2503/0x4ba0 net/ipv6/ip6_fib.c:1495
__ip6_ins_rt net/ipv6/route.c:1314 [inline]
ip6_ins_rt+0xb6/0x110 net/ipv6/route.c:1324
__ipv6_ifa_notify+0x9de/0xc30 net/ipv6/addrconf.c:6268
ipv6_ifa_notify net/ipv6/addrconf.c:6307 [inline]
add_addr+0x23e/0x350 net/ipv6/addrconf.c:3208
add_v4_addrs+0x71a/0xa00 net/ipv6/addrconf.c:3267
page last free pid 44 tgid 44 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1094 [inline]
free_unref_page+0x64a/0xe40 mm/page_alloc.c:2612
__folio_put+0x31c/0x3e0 mm/swap.c:128
folio_put include/linux/mm.h:1486 [inline]
migrate_folio_done+0x271/0x310 mm/migrate.c:1108
migrate_folio_move mm/migrate.c:1330 [inline]
migrate_pages_batch+0x1bc7/0x2fe0 mm/migrate.c:1812
migrate_pages_sync mm/migrate.c:1878 [inline]
migrate_pages+0x1b66/0x27a0 mm/migrate.c:1987
compact_zone+0x1f68/0x4280 mm/compaction.c:2671
compact_node+0x1a2/0x2d0 mm/compaction.c:2935
kcompactd+0x76e/0xde0 mm/compaction.c:3233
kthread+0x2c1/0x3a0 kernel/kthread.c:389
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Memory state around the buggy address:
ffff88801566ff80: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc
ffff888015670000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888015670080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888015670100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888015670180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: df 55 65 fists 0x65(%rbp)
3: 48 8b 2d a4 3a fc 74 mov 0x74fc3aa4(%rip),%rbp # 0x74fc3aae
a: 53 push %rbx
b: 48 89 eb mov %rbp,%rbx
e: 48 c1 eb 03 shr $0x3,%rbx
12: 48 01 c3 add %rax,%rbx
15: bf 01 00 00 00 mov $0x1,%edi
1a: e8 8f fa 53 f6 call 0xf653faae
1f: e8 6a c9 8a f6 call 0xf68ac98e
24: fb sti
25: bf 01 00 00 00 mov $0x1,%edi
* 2a: e8 4f a3 ff ff call 0xffffa37e <-- trapping instruction
2f: 9c pushf
30: 58 pop %rax
31: fa cli
32: f6 c4 02 test $0x2,%ah
35: 75 1e jne 0x55
37: bf 01 00 00 00 mov $0x1,%edi
3c: e8 .byte 0xe8
3d: bd .byte 0xbd
3e: 9e sahf
3f: 53 push %rbx