------------[ cut here ]------------ refcount_t: underflow; use-after-free. WARNING: CPU: 3 PID: 12901 at lib/refcount.c:28 refcount_warn_saturate+0x14a/0x210 lib/refcount.c:28 Modules linked in: CPU: 3 UID: 0 PID: 12901 Comm: syz.3.1755 Not tainted 6.11.0-rc7-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 RIP: 0010:refcount_warn_saturate+0x14a/0x210 lib/refcount.c:28 Code: ff 89 de e8 38 6e 04 fd 84 db 0f 85 66 ff ff ff e8 4b 6c 04 fd c6 05 d1 bb 75 0b 01 90 48 c7 c7 80 98 b0 8b e8 57 b7 c6 fc 90 <0f> 0b 90 90 e9 43 ff ff ff e8 28 6c 04 fd 0f b6 1d ac bb 75 0b 31 RSP: 0018:ffffc90000908bf8 EFLAGS: 00010086 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff814e1d09 RDX: ffff88803a792440 RSI: ffffffff814e1d16 RDI: 0000000000000001 RBP: ffff88804c68a118 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff88804c68a118 R13: ffff88804aedf400 R14: 0000000000000015 R15: 0000000000000000 FS: 00007f5c8e5746c0(0000) GS:ffff88806a900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000201fe000 CR3: 000000005bc52000 CR4: 0000000000350ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __refcount_sub_and_test include/linux/refcount.h:275 [inline] __refcount_dec_and_test include/linux/refcount.h:307 [inline] refcount_dec_and_test include/linux/refcount.h:325 [inline] p9_req_put+0x1ec/0x250 net/9p/client.c:404 req_done+0x1e7/0x2f0 net/9p/trans_virtio.c:147 vring_interrupt drivers/virtio/virtio_ring.c:2595 [inline] vring_interrupt+0x31b/0x400 drivers/virtio/virtio_ring.c:2570 __handle_irq_event_percpu+0x229/0x7c0 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:193 [inline] handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:210 handle_edge_irq+0x263/0xd10 kernel/irq/chip.c:831 generic_handle_irq_desc include/linux/irqdesc.h:173 [inline] handle_irq arch/x86/kernel/irq.c:247 [inline] call_irq_handler arch/x86/kernel/irq.c:259 [inline] __common_interrupt+0xdf/0x250 arch/x86/kernel/irq.c:285 common_interrupt+0x52/0xd0 arch/x86/kernel/irq.c:278 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 RIP: 0010:handle_softirqs+0x1da/0x8f0 kernel/softirq.c:540 Code: 89 44 24 18 48 89 6c 24 10 48 c7 c7 e0 76 4b 8b e8 9b dd c6 09 65 66 c7 05 39 c5 b3 7e 00 00 e8 5c 06 43 00 fb bb ff ff ff ff <49> c7 c6 c0 a0 a0 8d 41 0f bc dc 83 c3 01 0f 85 a7 00 00 00 e9 b4 RSP: 0018:ffffc90000908f30 EFLAGS: 00000206 RAX: 0000000000004d06 RBX: 00000000ffffffff RCX: 1ffffffff2d276c0 RDX: 0000000000000000 RSI: ffffffff8b4cd720 RDI: ffffffff8bb0fb40 RBP: ffff88803a792440 R08: 0000000000000001 R09: fffffbfff2d248e7 R10: ffffffff9692473f R11: 0000000000000000 R12: 0000000000000002 R13: 000000000000000a R14: 0000000000000001 R15: 0000000000000000 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x95/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 96 eb 74 53 48 89 eb 48 c1 eb 03 48 01 c3 bf 01 00 00 00 e8 9f bb 43 f6 e8 da d7 7a 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 ed 6b 43 RSP: 0018:ffffc90021627548 EFLAGS: 00000206 RAX: 0000000000004d03 RBX: ffffed10074f2488 RCX: 1ffffffff2d276c0 RDX: 0000000000000000 RSI: ffffffff8b4cd720 RDI: 0000000000000001 RBP: ffff88803a792440 R08: 0000000000000001 R09: fffffbfff2d248e7 R10: ffffffff9692473f 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:lock_acquire+0x1f2/0x560 kernel/locking/lockdep.c:5727 Code: c1 05 1a ba 98 7e 83 f8 01 0f 85 ea 02 00 00 9c 58 f6 c4 02 0f 85 d5 02 00 00 48 85 ed 74 01 fb 48 b8 00 00 00 00 00 fc ff df <48> 01 c3 48 c7 03 00 00 00 00 48 c7 43 08 00 00 00 00 48 8b 84 24 RSP: 0018:ffffc90021627618 EFLAGS: 00000206 RAX: dffffc0000000000 RBX: 1ffff920042c4ec5 RCX: 0000000000000001 RDX: 0000000000000001 RSI: ffffffff8b4cda20 RDI: ffffffff8bb0fb40 RBP: 0000000000000200 R08: 0000000000000000 R09: fffffbfff2d248e0 R10: ffffffff96924707 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: ffffffff8ddb9fe0 R15: 0000000000000000 rcu_lock_acquire include/linux/rcupdate.h:326 [inline] rcu_read_lock include/linux/rcupdate.h:838 [inline] __pte_offset_map+0x48/0x540 mm/pgtable-generic.c:287 __pte_offset_map_lock+0x8e/0x300 mm/pgtable-generic.c:371 pte_offset_map_lock include/linux/mm.h:3000 [inline] do_anonymous_page mm/memory.c:4531 [inline] do_pte_missing mm/memory.c:3945 [inline] handle_pte_fault mm/memory.c:5521 [inline] __handle_mm_fault+0x27bd/0x5660 mm/memory.c:5664 handle_mm_fault+0x498/0xa60 mm/memory.c:5832 do_user_addr_fault+0x7a3/0x13f0 arch/x86/mm/fault.c:1389 handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x5c/0xc0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 RIP: 0010:copy_user_generic arch/x86/include/asm/uaccess_64.h:110 [inline] RIP: 0010:raw_copy_from_user arch/x86/include/asm/uaccess_64.h:125 [inline] RIP: 0010:_inline_copy_from_user include/linux/uaccess.h:163 [inline] RIP: 0010:_copy_from_user+0xc1/0xf0 lib/usercopy.c:18 Code: 89 df e8 e2 63 04 fd 4d 85 f6 75 9e e8 28 62 04 fd 0f ae e8 89 ee 4c 89 ef e8 5b 2b 63 fd 0f 01 cb 48 89 e9 4c 89 ef 48 89 de a4 0f 1f 00 48 89 cb 0f 01 ca e9 73 ff ff ff e8 fa 61 04 fd 48 RSP: 0018:ffffc90021627b20 EFLAGS: 00050246 RAX: 0000000000000001 RBX: 00000000201fe000 RCX: 0000000000001000 RDX: 0000000000000000 RSI: 00000000201fe000 RDI: ffff888051ace000 RBP: 0000000000001000 R08: 0000000000000001 R09: ffffed100a359dff R10: ffff888051acefff R11: 0000000000000000 R12: 00000000201ff000 R13: ffff888051ace000 R14: 0000000000000000 R15: 00000000201fe000 copy_from_user include/linux/uaccess.h:196 [inline] snd_rawmidi_kernel_write1+0x4f9/0x880 sound/core/rawmidi.c:1555 snd_rawmidi_write+0x26d/0xc00 sound/core/rawmidi.c:1624 vfs_write+0x29a/0x1140 fs/read_write.c:588 ksys_write+0x1f8/0x260 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f5c8d77cef9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5c8e574038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f5c8d935f80 RCX: 00007f5c8d77cef9 RDX: 00000000fffffd2c RSI: 0000000020000000 RDI: 0000000000000005 RBP: 00007f5c8d7ef046 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f5c8d935f80 R15: 00007ffd6b53cbd8 ---------------- Code disassembly (best guess): 0: 89 44 24 18 mov %eax,0x18(%rsp) 4: 48 89 6c 24 10 mov %rbp,0x10(%rsp) 9: 48 c7 c7 e0 76 4b 8b mov $0xffffffff8b4b76e0,%rdi 10: e8 9b dd c6 09 call 0x9c6ddb0 15: 65 66 c7 05 39 c5 b3 movw $0x0,%gs:0x7eb3c539(%rip) # 0x7eb3c558 1c: 7e 00 00 1f: e8 5c 06 43 00 call 0x430680 24: fb sti 25: bb ff ff ff ff mov $0xffffffff,%ebx * 2a: 49 c7 c6 c0 a0 a0 8d mov $0xffffffff8da0a0c0,%r14 <-- trapping instruction 31: 41 0f bc dc bsf %r12d,%ebx 35: 83 c3 01 add $0x1,%ebx 38: 0f 85 a7 00 00 00 jne 0xe5 3e: e9 .byte 0xe9 3f: b4 .byte 0xb4