syzbot


WARNING: refcount bug in io_send_zc_cleanup (2)

Status: upstream: reported C repro on 2025/03/22 07:06
Subsystems: io-uring
[Documentation on labels]
Reported-by: syzbot+cf285a028ffba71b2ef5@syzkaller.appspotmail.com
Fix commit: 67c007d6c12d io_uring/net: fix sendzc double notif flush
Patched on: [ci-qemu-gce-upstream-auto ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-snapshot-upstream-root ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci2-upstream-fs ci2-upstream-kcsan-gce], missing on: [ci-qemu-native-arm64-kvm ci-qemu2-arm32 ci-qemu2-riscv64 ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-usb]
First crash: 2d11h, last: 2d07h
Cause bisection: introduced by (bisect log) :
commit cc34d8330e036b6bffa88db9ea537bae6b03948f
Author: Jens Axboe <axboe@kernel.dk>
Date: Thu Mar 20 18:25:12 2025 +0000

  io_uring/net: don't clear REQ_F_NEED_CLEANUP unconditionally

Crash: WARNING: refcount bug in io_send_zc_cleanup (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[syzbot] [io-uring?] WARNING: refcount bug in io_send_zc_cleanup (2) 1 (4) 2025/03/22 14:21
[PATCH] io_uring/net: fix sendzc double notif flush 1 (1) 2025/03/22 11:47
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING: refcount bug in io_send_zc_cleanup io-uring 1 778d 774d 0/28 auto-obsoleted due to no activity on 2023/04/05 17:06
Last patch testing requests (1)
Created Duration User Patch Repo Result
2025/03/22 09:04 22m asml.silence@gmail.com https://github.com/isilence/linux.git syz/sendzc-cleanup OK log

Sample crash report:
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 0 PID: 5823 at lib/refcount.c:28 refcount_warn_saturate+0x15a/0x1d0 lib/refcount.c:28
Modules linked in:
CPU: 0 UID: 0 PID: 5823 Comm: syz-executor232 Not tainted 6.14.0-rc7-syzkaller-00186-gd07de43e3f05 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
RIP: 0010:refcount_warn_saturate+0x15a/0x1d0 lib/refcount.c:28
Code: c0 e1 7f 8c e8 d7 bc 93 fc 90 0f 0b 90 90 eb 99 e8 6b 01 d4 fc c6 05 97 15 38 0b 01 90 48 c7 c7 20 e2 7f 8c e8 b7 bc 93 fc 90 <0f> 0b 90 90 e9 76 ff ff ff e8 48 01 d4 fc c6 05 71 15 38 0b 01 90
RSP: 0018:ffffc90003e8f9c0 EFLAGS: 00010246
RAX: bae32b5aa58f9a00 RBX: ffff88807f4ad8d0 RCX: ffff888034e08000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000003 R08: ffffffff81819d62 R09: fffffbfff1d3a69c
R10: dffffc0000000000 R11: fffffbfff1d3a69c R12: dffffc0000000000
R13: 1ffff11005aa3f80 R14: 1ffff1100fe95af6 R15: ffff88807f4ad7b0
FS:  000055557c8ba480(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000020000000022c CR3: 000000003574c000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 io_notif_flush io_uring/notif.h:40 [inline]
 io_send_zc_cleanup+0x121/0x170 io_uring/net.c:1222
 io_clean_op+0x58c/0x9a0 io_uring/io_uring.c:406
 io_free_batch_list io_uring/io_uring.c:1429 [inline]
 __io_submit_flush_completions+0xc16/0xd20 io_uring/io_uring.c:1470
 io_submit_flush_completions io_uring/io_uring.h:159 [inline]
 ctx_flush_and_put io_uring/io_uring.c:1031 [inline]
 io_handle_tw_list+0x473/0x500 io_uring/io_uring.c:1071
 tctx_task_work_run+0x9a/0x370 io_uring/io_uring.c:1123
 tctx_task_work+0x9a/0x100 io_uring/io_uring.c:1141
 task_work_run+0x24f/0x310 kernel/task_work.c:227
 ptrace_notify+0x2d9/0x380 kernel/signal.c:2522
 ptrace_report_syscall include/linux/ptrace.h:415 [inline]
 ptrace_report_syscall_exit include/linux/ptrace.h:477 [inline]
 syscall_exit_work+0xc7/0x1d0 kernel/entry/common.c:173
 syscall_exit_to_user_mode_prepare kernel/entry/common.c:200 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:205 [inline]
 syscall_exit_to_user_mode+0x24a/0x340 kernel/entry/common.c:218
 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fda97775569
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 00 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe9ef18ea8 EFLAGS: 00000216 ORIG_RAX: 00000000000001aa
RAX: 0000000000001000 RBX: 0000000000000007 RCX: 00007fda97775569
RDX: 0000000000000000 RSI: 00000000000047bc RDI: 0000000000000007
RBP: 0000200000000480 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000021 R11: 0000000000000216 R12: 000000000000081f
R13: 00002000000000c0 R14: 0000000000000001 R15: 0000000000000001
 </TASK>

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/03/22 02:29 upstream d07de43e3f05 62330552 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: refcount bug in io_send_zc_cleanup
2025/03/22 01:47 upstream d07de43e3f05 62330552 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: refcount bug in io_send_zc_cleanup
2025/03/21 23:09 upstream d07de43e3f05 62330552 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: refcount bug in io_send_zc_cleanup
2025/03/21 22:49 upstream d07de43e3f05 62330552 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: refcount bug in io_send_zc_cleanup
2025/03/21 21:57 upstream d07de43e3f05 62330552 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: refcount bug in io_send_zc_cleanup
2025/03/21 21:57 upstream d07de43e3f05 62330552 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: refcount bug in io_send_zc_cleanup
* Struck through repros no longer work on HEAD.