syzbot


WARNING: refcount bug in blk_mq_put_rq_ref

Status: upstream: reported on 2024/10/08 12:40
Reported-by: syzbot+2c26b3bd318fbeb5bf0b@syzkaller.appspotmail.com
First crash: 73d, last: 64d

Sample crash report:
refcount_t: underflow; use-after-free.
WARNING: CPU: 1 PID: 5953 at lib/refcount.c:28 refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28
Modules linked in:
CPU: 1 PID: 5953 Comm: syz.1.457 Not tainted 5.15.168-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28
lr : refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28
sp : ffff8000200d7740
x29: ffff8000200d7740 x28: ffff8000200d79e0 x27: 0000000000000002

x26: 1ffff0000401af3f x25: dfff800000000000 x24: ffff0000cc18dc00
x23: ffff0000cc328200 x22: ffff8000200d79f0 x21: 0000000000000003

x20: ffff0000cc3282e8 x19: ffff800016efe000 x18: 0000000000000001
x17: 0000000000000002 x16: ffff8000082ec8b8
 x15: 0000000000000012

x14: 1ffff0000295606a x13: dfff800000000000 x12: 0000000000040000
x11: 000000000003ffff x10: ffff80002612b000 x9 : 377c74539d5d8c00
x8 : 377c74539d5d8c00 x7 : 0000000000000000
 x6 : 0000000000000000

x5 : 0000000000000080 x4 : 0000000000000000 x3 : ffff80000804605c
x2 : 0000000000000006 x1 : 0000000100000000 x0 : 0000000000000026
Call trace:
 refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28
 __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]
 blk_mq_put_rq_ref+0xe8/0x11c block/blk-mq.c:925
 bt_tags_iter+0x1b0/0x260 block/blk-mq-tag.c:307
 __sbitmap_for_each_set include/linux/sbitmap.h:263 [inline]
 sbitmap_for_each_set+0x28c/0x4a4 include/linux/sbitmap.h:284
 bt_tags_for_each block/blk-mq-tag.c:334 [inline]
 __blk_mq_all_tag_iter block/blk-mq-tag.c:345 [inline]
 blk_mq_tagset_busy_iter+0x314/0x3f0 block/blk-mq-tag.c:386
 nbd_clear_que drivers/block/nbd.c:849 [inline]
 nbd_clear_sock drivers/block/nbd.c:1240 [inline]
 nbd_clear_sock_ioctl drivers/block/nbd.c:1379 [inline]
 __nbd_ioctl drivers/block/nbd.c:1407 [inline]
 nbd_ioctl+0x280/0xc2c drivers/block/nbd.c:1467
 blkdev_ioctl+0x3d8/0xbd0 block/ioctl.c:604
 block_ioctl+0xa8/0x114 block/fops.c:493
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl fs/ioctl.c:860 [inline]
 __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:860
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
irq event stamp: 132
hardirqs last  enabled at (131): [<ffff80000832af00>] console_unlock+0xc7c/0x1394 kernel/printk/printk.c:2748
hardirqs last disabled at (132): [<ffff800011ab7150>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:396
softirqs last  enabled at (8): [<ffff8000080308b0>] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:31
softirqs last disabled at (6): [<ffff80000803087c>] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:18
---[ end trace 296ce93e86f16cb1 ]---

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/17 20:00 linux-5.15.y 584a40a22cb9 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 WARNING: refcount bug in blk_mq_put_rq_ref
2024/10/08 12:40 linux-5.15.y 3a5928702e71 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 WARNING: refcount bug in blk_mq_put_rq_ref
* Struck through repros no longer work on HEAD.