usbtmc 5-1:16.0: usbtmc_write_bulk_cb - nonzero write bulk status received: -71
==================================================================
BUG: KASAN: slab-use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
BUG: KASAN: slab-use-after-free in do_raw_spin_lock+0x23a/0x260 kernel/locking/spinlock_debug.c:115
Read of size 4 at addr ffff888059d44884 by task udevd/5143
CPU: 0 UID: 0 PID: 5143 Comm: udevd Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0x13d/0x4b0 mm/kasan/report.c:482
kasan_report+0xdf/0x1c0 mm/kasan/report.c:595
debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
do_raw_spin_lock+0x23a/0x260 kernel/locking/spinlock_debug.c:115
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:156 [inline]
_raw_spin_lock_irqsave+0x42/0x60 kernel/locking/spinlock.c:181
__wake_up_common_lock kernel/sched/wait.c:125 [inline]
__wake_up+0x1c/0x60 kernel/sched/wait.c:147
__usb_unanchor_urb drivers/usb/core/urb.c:155 [inline]
usb_anchor_resume_wakeups+0xc7/0xf0 drivers/usb/core/urb.c:149
__usb_hcd_giveback_urb+0x3d8/0x610 drivers/usb/core/hcd.c:1660
usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1741
dummy_timer+0xdb2/0x3700 drivers/usb/gadget/udc/dummy_hcd.c:2019
__run_hrtimer kernel/time/hrtimer.c:2067 [inline]
__hrtimer_run_queues+0x462/0x9c0 kernel/time/hrtimer.c:2124
hrtimer_run_softirq+0x1ca/0x360 kernel/time/hrtimer.c:2141
handle_softirqs+0x1e6/0x9d0 kernel/softirq.c:645
__do_softirq kernel/softirq.c:679 [inline]
invoke_softirq kernel/softirq.c:519 [inline]
__irq_exit_rcu+0x194/0x210 kernel/softirq.c:767
irq_exit_rcu+0x9/0x30 kernel/softirq.c:784
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline]
sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1062
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674
RIP: 0010:arch_atomic_try_cmpxchg arch/x86/include/asm/atomic.h:107 [inline]
RIP: 0010:raw_atomic_try_cmpxchg_acquire include/linux/atomic/atomic-arch-fallback.h:2170 [inline]
RIP: 0010:atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:1302 [inline]
RIP: 0010:queued_spin_lock include/asm-generic/qspinlock.h:112 [inline]
RIP: 0010:do_raw_spin_lock+0x139/0x260 kernel/locking/spinlock_debug.c:116
Code: 28 00 00 00 00 e8 77 9d 97 00 be 04 00 00 00 48 8d 7c 24 28 e8 68 9d 97 00 8b 44 24 28 ba 01 00 00 00 89 44 24 04 f0 0f b1 13 <0f> 85 93 00 00 00 48 89 ea 65 44 8b 35 7e 84 a4 12 48 b8 00 00 00
RSP: 0018:ffffc900042f76c8 EFLAGS: 00000246
RAX: 0000000000000000 RBX: ffff888039e0a0b8 RCX: ffffffff81e78b98
RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffffc900042f76f0
RBP: ffff888039e0a0c0 R08: 0000000000000001 R09: fffff5200085eede
R10: 0000000000000003 R11: 0000000000000000 R12: 1ffff9200085eeda
R13: ffff888039e0a0c8 R14: ffff8880396ced88 R15: 0000000000000000
spin_lock include/linux/spinlock.h:347 [inline]
dentry_kill+0x329/0xc20 fs/dcache.c:837
shrink_kill fs/dcache.c:1275 [inline]
shrink_dentry_list+0x1e8/0x310 fs/dcache.c:1292
shrink_dcache_tree+0x20e/0x410 fs/dcache.c:1759
shrink_dcache_parent fs/dcache.c:1767 [inline]
d_invalidate fs/dcache.c:1875 [inline]
d_invalidate+0x13a/0x290 fs/dcache.c:1860
lookup_fast+0x3f4/0x600 fs/namei.c:1885
walk_component fs/namei.c:2278 [inline]
link_path_walk+0x7d4/0x1cc0 fs/namei.c:2656
path_openat+0x1ac/0x2440 fs/namei.c:4996
do_file_open+0x20e/0x430 fs/namei.c:5029
do_sys_openat2+0x10f/0x1e0 fs/open.c:1417
do_sys_open fs/open.c:1423 [inline]
__do_sys_openat fs/open.c:1439 [inline]
__se_sys_openat fs/open.c:1434 [inline]
__x64_sys_openat+0x12d/0x210 fs/open.c:1434
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fcf784a7407
Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff
RSP: 002b:00007ffd27980940 EFLAGS: 00000202 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007fcf78c3b880 RCX: 00007fcf784a7407
RDX: 0000000000080000 RSI: 00007ffd27980ac0 RDI: ffffffffffffff9c
RBP: 0000000000000008 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 00005626baa597f5
R13: 00005626baa597f5 R14: 0000000000000001 R15: 0000000000000000
Allocated by task 8005:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415
kasan_kmalloc include/linux/kasan.h:263 [inline]
__kmalloc_cache_noprof+0x2f8/0x6d0 mm/slub.c:5563
_kmalloc_noprof include/linux/slab.h:991 [inline]
_kzalloc_noprof include/linux/slab.h:1312 [inline]
usbtmc_open+0xa9/0x8f0 drivers/usb/class/usbtmc.c:174
usb_open+0x189/0x220 drivers/usb/core/file.c:47
chrdev_open+0x234/0x6a0 fs/char_dev.c:411
do_dentry_open+0x6ab/0x14d0 fs/open.c:996
vfs_open+0x82/0x3f0 fs/open.c:1101
do_open fs/namei.c:4837 [inline]
path_openat+0x19fa/0x2440 fs/namei.c:5000
do_file_open+0x20e/0x430 fs/namei.c:5029
do_sys_openat2+0x10f/0x1e0 fs/open.c:1417
do_sys_open fs/open.c:1423 [inline]
__do_sys_openat fs/open.c:1439 [inline]
__se_sys_openat fs/open.c:1434 [inline]
__x64_sys_openat+0x12d/0x210 fs/open.c:1434
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 8004:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:253 [inline]
__kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:2748 [inline]
slab_free mm/slub.c:6499 [inline]
kfree+0x22b/0x6d0 mm/slub.c:6792
usbtmc_release+0x2a6/0x3d0 drivers/usb/class/usbtmc.c:263
__fput+0x3ff/0xb50 fs/file_table.c:512
task_work_run+0x150/0x240 kernel/task_work.c:233
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
__exit_to_user_mode_loop kernel/entry/common.c:70 [inline]
exit_to_user_mode_loop+0x1d8/0x700 kernel/entry/common.c:101
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:336 [inline]
do_syscall_64+0x661/0x790 arch/x86/entry/syscall_64.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff888059d44800
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 132 bytes inside of
freed 1024-byte region [ffff888059d44800, ffff888059d44c00)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x59d40
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: f5(slab)
raw: 00fff00000000040 ffff88801c042dc0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801c042dc0 dead000000000100 dead000000000122
head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000003 fffffffffffffe01 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008
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 13, tgid 13 (kworker/u32:1), ts 49470143037
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1871
prep_new_page mm/page_alloc.c:1879 [inline]
get_page_from_freelist+0x110d/0x35d0 mm/page_alloc.c:3943
__alloc_frozen_pages_noprof+0x2eb/0x3300 mm/page_alloc.c:5436
alloc_slab_page mm/slub.c:3347 [inline]
allocate_slab mm/slub.c:3462 [inline]
new_slab+0xa9/0x6e0 mm/slub.c:3513
refill_objects+0xe3/0x410 mm/slub.c:7410
refill_sheaf mm/slub.c:2885 [inline]
__pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4774
alloc_from_pcs mm/slub.c:4850 [inline]
slab_alloc_node mm/slub.c:4984 [inline]
__do_kmalloc_node mm/slub.c:5413 [inline]
__kmalloc_noprof+0x67c/0x840 mm/slub.c:5439
_kmalloc_noprof include/linux/slab.h:995 [inline]
_kzalloc_noprof include/linux/slab.h:1312 [inline]
neigh_alloc net/core/neighbour.c:518 [inline]
___neigh_create+0x1532/0x2940 net/core/neighbour.c:652
ip6_finish_output2+0x1052/0x1d50 net/ipv6/ip6_output.c:130
__ip6_finish_output+0x357/0xdf0 net/ipv6/ip6_output.c:210
ip6_finish_output net/ipv6/ip6_output.c:221 [inline]
NF_HOOK_COND include/linux/netfilter.h:314 [inline]
ip6_output+0x2aa/0xa60 net/ipv6/ip6_output.c:248
dst_output include/net/dst.h:470 [inline]
NF_HOOK include/linux/netfilter.h:325 [inline]
ndisc_send_skb+0xa85/0x1bf0 net/ipv6/ndisc.c:513
ndisc_send_ns+0xc6/0x140 net/ipv6/ndisc.c:672
addrconf_dad_work+0xca1/0x1360 net/ipv6/addrconf.c:4318
process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396
process_scheduled_works kernel/workqueue.c:3479 [inline]
worker_thread+0x5ef/0xe50 kernel/workqueue.c:3560
page_owner free stack trace missing
Memory state around the buggy address:
ffff888059d44780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888059d44800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888059d44880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888059d44900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888059d44980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 28 00 sub %al,(%rax)
2: 00 00 add %al,(%rax)
4: 00 e8 add %ch,%al
6: 77 9d ja 0xffffffa5
8: 97 xchg %eax,%edi
9: 00 be 04 00 00 00 add %bh,0x4(%rsi)
f: 48 8d 7c 24 28 lea 0x28(%rsp),%rdi
14: e8 68 9d 97 00 call 0x979d81
19: 8b 44 24 28 mov 0x28(%rsp),%eax
1d: ba 01 00 00 00 mov $0x1,%edx
22: 89 44 24 04 mov %eax,0x4(%rsp)
26: f0 0f b1 13 lock cmpxchg %edx,(%rbx)
* 2a: 0f 85 93 00 00 00 jne 0xc3 <-- trapping instruction
30: 48 89 ea mov %rbp,%rdx
33: 65 44 8b 35 7e 84 a4 mov %gs:0x12a4847e(%rip),%r14d # 0x12a484b9
3a: 12
3b: 48 rex.W
3c: b8 .byte 0xb8
3d: 00 00 add %al,(%rax)