syzbot


WARNING: refcount bug in p9_req_put (3)

Status: upstream: reported C repro on 2024/01/26 09:05
Subsystems: v9fs
[Documentation on labels]
Reported-by: syzbot+d99d2414db66171fccbb@syzkaller.appspotmail.com
First crash: 304d, last: 11d
Discussions (3)
Title Replies (including bot) Last reply
[syzbot] Monthly v9fs report (Aug 2024) 0 (1) 2024/08/29 13:20
[syzbot] [net?] [v9fs?] WARNING: refcount bug in p9_req_put (3) 2 (4) 2024/07/22 06:14
[syzbot] Monthly v9fs report (Apr 2024) 0 (1) 2024/04/30 07:12
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 WARNING: refcount bug in p9_req_put 2 1847d 1888d 0/1 auto-closed as invalid on 2020/02/28 21:29
upstream WARNING: refcount bug in p9_req_put v9fs syz inconclusive done 6 1644d 2197d 15/28 fixed on 2020/11/16 12:12
upstream WARNING: refcount bug in p9_req_put (2) v9fs 9 448d 794d 0/28 auto-obsoleted due to no activity on 2023/12/09 05:29
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/09/23 13:53 19m retest repro upstream OK log

Sample crash report:
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 3 PID: 6217 at lib/refcount.c:28 refcount_warn_saturate+0x14a/0x210 lib/refcount.c:28
Modules linked in:
CPU: 3 UID: 0 PID: 6217 Comm: syz-executor Not tainted 6.12.0-rc6-syzkaller-00272-gda4373fbcf00 #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 18 f5 fc fc 84 db 0f 85 66 ff ff ff e8 2b f3 fc fc c6 05 d8 92 b7 0b 01 90 48 c7 c7 c0 60 d1 8b e8 a7 e4 bd fc 90 <0f> 0b 90 90 e9 43 ff ff ff e8 08 f3 fc fc 0f b6 1d b3 92 b7 0b 31
RSP: 0018:ffffc90000908bf8 EFLAGS: 00010086
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff814e6e79
RDX: ffff8880242a8000 RSI: ffffffff814e6e86 RDI: 0000000000000001
RBP: ffff888032224558 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff888032224558
R13: ffff88804c693400 R14: 0000000000000015 R15: 0000000000000000
FS:  000055557638a500(0000) GS:ffff88806a900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fdbb7e27ae0 CR3: 000000003160e000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <IRQ>
 __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+0x61/0xe0 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 20 71 6b 8b e8 eb 11 d3 09 65 66 c7 05 f9 70 b3 7e 00 00 e8 2c bd 44 00 fb bb ff ff ff ff <49> c7 c6 c0 a0 e0 8d 41 0f bc dc 83 c3 01 0f 85 a4 00 00 00 e9 b1
RSP: 0018:ffffc90000908f30 EFLAGS: 00000212
RAX: 0000000000000170 RBX: 00000000ffffffff RCX: 1ffffffff20be2d1
RDX: 0000000000000000 RSI: ffffffff8b6cd040 RDI: ffffffff8bd1b3c0
RBP: ffff8880242a8000 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff905f58cf R11: 0000000000000000 R12: 0000000000000282
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:1049 [inline]
 sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1049
 </IRQ>
 <TASK>
 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:7012
Code: df 55 65 48 8b 2d 74 48 df 74 53 48 89 eb 48 c1 eb 03 48 01 c3 bf 01 00 00 00 e8 8f dc 37 f6 e8 ba 94 70 f6 fb bf 01 00 00 00 <e8> 9f a0 ff ff 9c 58 fa f6 c4 02 75 1e bf 01 00 00 00 e8 2d 8f 37
RSP: 0018:ffffc9000416fd68 EFLAGS: 00000202
RAX: 000000000000016b RBX: ffffed1004855000 RCX: 1ffffffff20be2d1
RDX: 0000000000000000 RSI: ffffffff8b6cd040 RDI: 0000000000000001
RBP: ffff8880242a8000 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff905f58cf 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:memset_orig+0x3a/0xb0 arch/x86/lib/memset_64.S:69
Code: 01 01 01 01 01 48 0f af c1 41 89 f9 41 83 e1 07 75 70 48 89 d1 48 c1 e9 06 74 35 0f 1f 44 00 00 48 ff c9 48 89 07 48 89 47 08 <48> 89 47 10 48 89 47 18 48 89 47 20 48 89 47 28 48 89 47 30 48 89
RSP: 0018:ffffc9000416fe38 EFLAGS: 00000202
RAX: 0000000000000000 RBX: 0000000000001000 RCX: 0000000000000015
RDX: 0000000000001000 RSI: 0000000000000000 RDI: ffff8880490b8a80
RBP: ffffc9000416fe90 R08: 0000000000000000 R09: 0000000000000000
R10: ffff8880490b8000 R11: 0000000000000000 R12: ffff888100089cc0
R13: 0000000000000cc0 R14: 0000000000001000 R15: 0000000000000001
 slab_post_alloc_hook mm/slub.c:4088 [inline]
 slab_alloc_node mm/slub.c:4134 [inline]
 kmem_cache_alloc_noprof+0x13c/0x2f0 mm/slub.c:4141
 getname_flags.part.0+0x4c/0x550 fs/namei.c:139
 getname_flags+0x93/0xf0 include/linux/audit.h:322
 getname fs/namei.c:225 [inline]
 __do_sys_symlinkat fs/namei.c:4657 [inline]
 __se_sys_symlinkat fs/namei.c:4654 [inline]
 __x64_sys_symlinkat+0x79/0xc0 fs/namei.c:4654
 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:0x7fdbb7d7dc97
Code: 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 0a 01 00 00 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:00007fffabb9cca8 EFLAGS: 00000202 ORIG_RAX: 000000000000010a
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fdbb7d7dc97
RDX: 00007fdbb7df2ad2 RSI: 00000000ffffff9c RDI: 00007fffabb9cd30
RBP: 00007fffabb9ccdc R08: 0000000000000013 R09: 00007fffabb9c9f7
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000032
R13: 000000000001b6c4 R14: 000000000001b514 R15: 00007fffabb9cd30
 </TASK>
----------------
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 20 71 6b 8b 	mov    $0xffffffff8b6b7120,%rdi
  10:	e8 eb 11 d3 09       	call   0x9d31200
  15:	65 66 c7 05 f9 70 b3 	movw   $0x0,%gs:0x7eb370f9(%rip)        # 0x7eb37118
  1c:	7e 00 00
  1f:	e8 2c bd 44 00       	call   0x44bd50
  24:	fb                   	sti
  25:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
* 2a:	49 c7 c6 c0 a0 e0 8d 	mov    $0xffffffff8de0a0c0,%r14 <-- trapping instruction
  31:	41 0f bc dc          	bsf    %r12d,%ebx
  35:	83 c3 01             	add    $0x1,%ebx
  38:	0f 85 a4 00 00 00    	jne    0xe2
  3e:	e9                   	.byte 0xe9
  3f:	b1                   	.byte 0xb1

Crashes (21):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/10 01:22 upstream da4373fbcf00 6b856513 .config console log report syz / log [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in p9_req_put
2024/11/09 22:02 upstream da4373fbcf00 6b856513 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in p9_req_put
2024/09/09 13:41 upstream da3ea35007d0 8f722c94 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in p9_req_put
2024/08/02 22:09 upstream 948752d2e010 53683cf2 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in p9_req_put
2024/08/02 22:09 upstream 948752d2e010 53683cf2 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in p9_req_put
2024/07/31 12:35 upstream c91a7dee0555 6fde257d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in p9_req_put
2024/07/31 12:29 upstream c91a7dee0555 6fde257d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in p9_req_put
2024/07/22 06:13 upstream 7846b618e0a4 b88348e9 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in p9_req_put
2024/07/22 04:03 upstream 7846b618e0a4 b88348e9 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in p9_req_put
2024/05/15 16:45 upstream 1b294a1f3561 7e8e0c0f .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in p9_req_put
2024/04/15 09:24 upstream 72374d71c315 c8349e48 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in p9_req_put
2024/04/15 09:24 upstream 72374d71c315 c8349e48 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in p9_req_put
2024/03/02 16:41 upstream 5ad3cb0ed525 25905f5d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in p9_req_put
2024/08/31 21:58 upstream 1934261d8974 1eda0d14 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 WARNING: refcount bug in p9_req_put
2024/08/28 00:16 upstream 3ec3f5fc4a91 a1a7b2f0 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 WARNING: refcount bug in p9_req_put
2024/08/15 15:32 upstream 1fb918967b56 e4bacdaf .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 WARNING: refcount bug in p9_req_put
2024/08/01 21:05 upstream c0ecd6388360 1e9c4cf3 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 WARNING: refcount bug in p9_req_put
2024/05/21 06:14 upstream 6e51b4b5bbc0 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 WARNING: refcount bug in p9_req_put
2024/04/21 01:47 upstream 977b1ef51866 af24b050 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 WARNING: refcount bug in p9_req_put
2024/01/27 14:27 upstream 3a5879d495b2 cc4a4020 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 WARNING: refcount bug in p9_req_put
2024/01/21 21:11 upstream 4fbbed787267 9bd8dcda .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 WARNING: refcount bug in p9_req_put
* Struck through repros no longer work on HEAD.