WARNING: refcount bug in gadgetfs_kill_sb

Status: upstream: reported on 2026/08/31 21:49
Reported-by: syzbot+d8c84cc047113ec8707e@syzkaller.appspotmail.com
First crash: 40d, last: 3d21h
▶ ▼ Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING: refcount bug in gadgetfs_kill_sb usb 13 syz, C 3 1372d 1387d 0/29 auto-obsoleted due to no activity on 2023/05/08 00:34

Sample crash report:
WARNING: CPU: 1 PID: 5370 at lib/refcount.c:28 refcount_warn_saturate+0x11b/0x1a0 lib/refcount.c:28
Modules linked in:
CPU: 1 PID: 5370 Comm: syz-executor Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/2026
RIP: 0010:refcount_warn_saturate+0x11b/0x1a0 lib/refcount.c:28
Code: 09 01 48 c7 c7 e0 0c 7a 8a e8 b1 f5 cd 05 0f 0b eb c4 e8 38 ef 8f fd c6 05 c3 3d 8e 09 01 48 c7 c7 40 0d 7a 8a e8 95 f5 cd 05 <0f> 0b eb a8 e8 1c ef 8f fd c6 05 a4 3d 8e 09 01 48 c7 c7 80 0c 7a
RSP: 0018:ffffc900032ffc90 EFLAGS: 00010246
RAX: 7132487fff7ac300 RBX: 0000000000000003 RCX: ffff888022600000
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffff8880b9133d7f R09: 1ffff110172267af
R10: dffffc0000000000 R11: ffffed10172267b0 R12: ffffe8ffffd73284
R13: 1ffffffff1b165be R14: 0000000000000003 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8880b9100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f9b088802f8 CR3: 0000000065c72000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 00000000000001f8 DR2: 0000000000000002
DR3: ffffffffefffff15 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __refcount_sub_and_test include/linux/refcount.h:283 [inline]
 __refcount_dec_and_test include/linux/refcount.h:315 [inline]
 refcount_dec_and_test include/linux/refcount.h:333 [inline]
 put_dev drivers/usb/gadget/legacy/inode.c:159 [inline]
 gadgetfs_kill_sb+0xf7/0x100 drivers/usb/gadget/legacy/inode.c:2103
 deactivate_locked_super+0x93/0xf0 fs/super.c:335
 cleanup_mnt+0x426/0x4d0 fs/namespace.c:1148
 task_work_run+0x125/0x1a0 kernel/task_work.c:188
 exit_task_work include/linux/task_work.h:33 [inline]
 do_exit+0x635/0x2110 kernel/exit.c:890
 do_group_exit+0x12c/0x2f0 kernel/exit.c:1004
 __do_sys_exit_group kernel/exit.c:1015 [inline]
 __se_sys_exit_group kernel/exit.c:1013 [inline]
 __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1013
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f19116ab199
Code: Unable to access opcode bytes at RIP 0x7f19116ab16f.
RSP: 002b:00007fff3b665128 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007f1911741d83 RCX: 00007f19116ab199
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001
RBP: 0000000000000002 R08: 0000000000000000 R09: 00007f1911741d23
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff3b6663e0
R13: 00007f1911741d23 R14: 000055558a0194e8 R15: 00007fff3b6685a0
 </TASK>

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/10/07 04:49 linux-5.15.y a051a4bf909f f7710056 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: refcount bug in gadgetfs_kill_sb
2026/09/04 13:54 linux-5.15.y 0996e0926f6b f65209a4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: refcount bug in gadgetfs_kill_sb
2026/09/02 19:44 linux-5.15.y 0996e0926f6b 85995287 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: refcount bug in gadgetfs_kill_sb
2026/08/31 21:49 linux-5.15.y 28c35638ec51 316d9396 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: refcount bug in gadgetfs_kill_sb
* Struck through repros no longer work on HEAD.