[v5.15] WARNING: refcount bug in blk_mq_free_request

1 view
Skip to first unread message

syzbot

unread,
Aug 8, 2024, 5:49:24 AM8/8/24
Hello,

syzbot found the following issue on:

HEAD commit: 7e89efd3ae1c Linux 5.15.164
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=178f6623980000
kernel config: https://syzkaller.appspot.com/x/.config?x=8e7768447c833306
dashboard link: https://syzkaller.appspot.com/bug?extid=68d100a516c9c17658b1
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/3d929e236949/disk-7e89efd3.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/8a76a46947c4/vmlinux-7e89efd3.xz
kernel image: https://storage.googleapis.com/syzbot-assets/12f4fa036ad7/Image-7e89efd3.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]

------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 0 PID: 149 at lib/refcount.c:28 refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28
Modules linked in:
CPU: 0 PID: 149 Comm: kworker/0:1H Not tainted 5.15.164-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
Workqueue: kblockd blk_mq_run_work_fn
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 : ffff80001a647590
x29: ffff80001a647590 x28: fffffbffefff2240 x27: 1fffe000197b9083
x26: 1fffe000197b9083 x25: 0000000000000000 x24: 0000000000000001
x23: dfff800000000000 x22: fffffbffefff2308 x21: 0000000000000003
x20: ffff0000cbdc84e8 x19: ffff800016f0e000 x18: 0000000000000001
x17: 0000000000000000 x16: ffff800011ab8a28 x15: 00000000ffffffff
x14: ffff0000c5459b40 x13: 0000000000000001 x12: 0000000000000001
x11: 0000000000000000 x10: 0000000000000000 x9 : 0f4293b97ea70b00
x8 : 0f4293b97ea70b00 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff80001a646cf8 x4 : ffff800014b9f960 x3 : ffff80000855531c
x2 : 0000000000000001 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_free_request+0x440/0x584 block/blk-mq.c:543
__blk_mq_end_request+0x318/0x350 block/blk-mq.c:568
blk_mq_end_request block/blk-mq.c:577 [inline]
blk_mq_dispatch_rq_list+0x9c8/0x14ac block/blk-mq.c:1408
__blk_mq_do_dispatch_sched block/blk-mq-sched.c:200 [inline]
blk_mq_do_dispatch_sched+0x8b4/0x9f4 block/blk-mq-sched.c:214
__blk_mq_sched_dispatch_requests+0x310/0x420
blk_mq_sched_dispatch_requests+0xbc/0x138 block/blk-mq-sched.c:366
__blk_mq_run_hw_queue block/blk-mq.c:1511 [inline]
blk_mq_run_work_fn+0x150/0x208 block/blk-mq.c:1842
process_one_work+0x790/0x11b8 kernel/workqueue.c:2310
worker_thread+0x910/0x1034 kernel/workqueue.c:2457
kthread+0x37c/0x45c kernel/kthread.c:334
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870
irq event stamp: 7754
hardirqs last enabled at (7753): [<ffff80000832b6d8>] __up_console_sem+0xb4/0x100 kernel/printk/printk.c:257
hardirqs last disabled at (7754): [<ffff800011ab40b4>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:396
softirqs last enabled at (7726): [<ffff8000081b6574>] softirq_handle_end kernel/softirq.c:401 [inline]
softirqs last enabled at (7726): [<ffff8000081b6574>] handle_softirqs+0xb88/0xdbc kernel/softirq.c:586
softirqs last disabled at (7047): [<ffff8000081b6c0c>] __do_softirq kernel/softirq.c:592 [inline]
softirqs last disabled at (7047): [<ffff8000081b6c0c>] do_softirq_own_stack include/asm-generic/softirq_stack.h:10 [inline]
softirqs last disabled at (7047): [<ffff8000081b6c0c>] invoke_softirq kernel/softirq.c:439 [inline]
softirqs last disabled at (7047): [<ffff8000081b6c0c>] __irq_exit_rcu+0x268/0x4d8 kernel/softirq.c:641
---[ end trace 63aa71ceaf6f1356 ]---
blk_update_request: I/O error, dev nbd2, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev nbd2, logical block 0, async page read


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at [email protected].

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Sep 27, 2024, 7:55:32 AM9/27/24
syzbot has found a reproducer for the following issue on:

HEAD commit: 3a5928702e71 Linux 5.15.167
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1623f627980000
kernel config: https://syzkaller.appspot.com/x/.config?x=171882977b524c53
dashboard link: https://syzkaller.appspot.com/bug?extid=68d100a516c9c17658b1
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1008ba80580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/22ee27cb312d/disk-3a592870.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/90bf6a3e3d20/vmlinux-3a592870.xz
kernel image: https://storage.googleapis.com/syzbot-assets/096dd2c73ac3/Image-3a592870.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]

------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 0 PID: 226 at lib/refcount.c:28 refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28
Modules linked in:
CPU: 0 PID: 226 Comm: kworker/0:1H Not tainted 5.15.167-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Workqueue: kblockd blk_mq_run_work_fn
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 : ffff80001f0b7590
x29: ffff80001f0b7590 x28: fffffbffeffd1d00 x27: 1fffe0001987c703
x26: 1fffe0001987c703 x25: 0000000000000000 x24: 0000000000000001
x23: dfff800000000000 x22: fffffbffeffd1dc8 x21: 0000000000000003
x20: ffff0000cc3e38e8 x19: ffff800016f0c000 x18: 0000000000000001
x17: 0000000000000000 x16: ffff800011ac23e0 x15: 00000000ffffffff
x14: ffff0000c6820000 x13: 0000000000000001 x12: 0000000000000001
x11: 0000000000000000 x10: 0000000000000000 x9 : a7861871209f4200
x8 : a7861871209f4200 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff80001f0b6cf8 x4 : ffff800014b9fae0 x3 : ffff800008557c4c
x2 : 0000000000000001 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_free_request+0x440/0x584 block/blk-mq.c:543
__blk_mq_end_request+0x318/0x350 block/blk-mq.c:568
blk_mq_end_request block/blk-mq.c:577 [inline]
blk_mq_dispatch_rq_list+0x9c8/0x14ac block/blk-mq.c:1408
__blk_mq_do_dispatch_sched block/blk-mq-sched.c:200 [inline]
blk_mq_do_dispatch_sched+0x8b4/0x9f4 block/blk-mq-sched.c:214
__blk_mq_sched_dispatch_requests+0x310/0x420
blk_mq_sched_dispatch_requests+0xbc/0x138 block/blk-mq-sched.c:366
__blk_mq_run_hw_queue block/blk-mq.c:1511 [inline]
blk_mq_run_work_fn+0x150/0x208 block/blk-mq.c:1842
process_one_work+0x790/0x11b8 kernel/workqueue.c:2310
worker_thread+0x910/0x1034 kernel/workqueue.c:2457
kthread+0x37c/0x45c kernel/kthread.c:334
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870
irq event stamp: 56040
hardirqs last enabled at (56039): [<ffff80000832c17c>] __up_console_sem+0xb4/0x100 kernel/printk/printk.c:257
hardirqs last disabled at (56040): [<ffff800011abda6c>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:396
softirqs last enabled at (56010): [<ffff8000081b6d74>] softirq_handle_end kernel/softirq.c:401 [inline]
softirqs last enabled at (56010): [<ffff8000081b6d74>] handle_softirqs+0xb88/0xdbc kernel/softirq.c:586
softirqs last disabled at (55541): [<ffff8000081b740c>] __do_softirq kernel/softirq.c:592 [inline]
softirqs last disabled at (55541): [<ffff8000081b740c>] do_softirq_own_stack include/asm-generic/softirq_stack.h:10 [inline]
softirqs last disabled at (55541): [<ffff8000081b740c>] invoke_softirq kernel/softirq.c:439 [inline]
softirqs last disabled at (55541): [<ffff8000081b740c>] __irq_exit_rcu+0x268/0x4d8 kernel/softirq.c:641
---[ end trace 501afd60825cd4fd ]---
blk_update_request: I/O error, dev nbd3, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev nbd3, logical block 0, async page read


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

syzbot

unread,
Sep 28, 2024, 10:12:26 AM9/28/24
syzbot has found a reproducer for the following issue on:

HEAD commit: 3a5928702e71 Linux 5.15.167
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=128b3e27980000
kernel config: https://syzkaller.appspot.com/x/.config?x=171882977b524c53
dashboard link: https://syzkaller.appspot.com/bug?extid=68d100a516c9c17658b1
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11a35507980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15a35507980000

Downloadable assets:
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]

------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 1 PID: 20 at lib/refcount.c:28 refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28
Modules linked in:
CPU: 1 PID: 20 Comm: ksoftirqd/1 Not tainted 5.15.167-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 : ffff80001bcf7b40
x29: ffff80001bcf7b40 x28: fffffbffefff3600 x27: 1fffe0001991c903
x26: 1fffe0001991c903 x25: 0000000000000000
x24: 0000000000000001
x23: dfff800000000000 x22: fffffbffefff36c8 x21: 0000000000000003
x20: ffff0000cc8e48e8
x19: ffff800016f0c000 x18: 0000000000000101
x17: 0000000000000000 x16: ffff800011ac23e0 x15: 00000000ffffffff
x14: ffff0000c0a80000
x13: 0000000000121b58 x12: 0000000000000001
x11: 0000000000000100 x10: 0000000000000000 x9 : 03a3309e4d8a9600
x8 : 03a3309e4d8a9600
x7 : 0000000000121b58 x6 : 0000000000121b28
x5 : ffff80001bcf72b8 x4 : ffff800014b76320 x3 : ffff80000a987d1c

x2 : ffff0001b41aed10 x1 : 0000000000000100 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_free_request+0x440/0x584 block/blk-mq.c:543
__blk_mq_end_request+0x318/0x350 block/blk-mq.c:568
blk_mq_end_request+0x68/0x88 block/blk-mq.c:577
nbd_complete_rq+0x48/0x154 drivers/block/nbd.c:360
blk_complete_reqs block/blk-mq.c:587 [inline]
blk_done_softirq+0x11c/0x168 block/blk-mq.c:592
handle_softirqs+0x384/0xdbc kernel/softirq.c:558
run_ksoftirqd+0x6c/0x29c kernel/softirq.c:925
smpboot_thread_fn+0x4b0/0x920 kernel/smpboot.c:164
kthread+0x37c/0x45c kernel/kthread.c:334
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870
irq event stamp: 965579
hardirqs last enabled at (965578): [<ffff80000832c17c>] __up_console_sem+0xb4/0x100 kernel/printk/printk.c:257
hardirqs last disabled at (965579): [<ffff800011abda6c>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:396
softirqs last enabled at (965532): [<ffff8000081b6d74>] softirq_handle_end kernel/softirq.c:401 [inline]
softirqs last enabled at (965532): [<ffff8000081b6d74>] handle_softirqs+0xb88/0xdbc kernel/softirq.c:586
softirqs last disabled at (965537): [<ffff8000081b98a4>] run_ksoftirqd+0x6c/0x29c kernel/softirq.c:925
---[ end trace 8b4f5a70527e24e6 ]---
Reply all
Reply to author
Forward
0 new messages