WARNING: refcount bug in nbd_config_put

10 views
Skip to first unread message

syzbot

unread,
Mar 5, 2021, 7:49:18 PM3/5/21
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 397a88b2 Linux 4.14.223
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15d499bcd00000
kernel config: https://syzkaller.appspot.com/x/.config?x=104119cfe8dba6b3
dashboard link: https://syzkaller.appspot.com/bug?extid=fad2d1005c1d27e448c2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17998fdad00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10bd7566d00000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+fad2d1...@syzkaller.appspotmail.com

refcount_t: underflow; use-after-free.
------------[ cut here ]------------
WARNING: CPU: 1 PID: 8118 at lib/refcount.c:281 refcount_dec_not_one.cold+0x18/0x25 lib/refcount.c:281
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 8118 Comm: systemd-udevd Not tainted 4.14.223-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x1b2/0x281 lib/dump_stack.c:58
panic+0x1f9/0x42d kernel/panic.c:183
__warn.cold+0x20/0x44 kernel/panic.c:547
report_bug+0x208/0x250 lib/bug.c:186
fixup_bug arch/x86/kernel/traps.c:177 [inline]
fixup_bug arch/x86/kernel/traps.c:172 [inline]
do_error_trap+0x195/0x2d0 arch/x86/kernel/traps.c:295
invalid_op+0x1b/0x40 arch/x86/entry/entry_64.S:964
RIP: 0010:refcount_dec_not_one.cold+0x18/0x25 lib/refcount.c:281
RSP: 0018:ffff8880b045fc38 EFLAGS: 00010286
RAX: 0000000000000026 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff878bbb80 RDI: ffffed101608bf7d
RBP: ffff8880b3349158 R08: 0000000000000026 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 00000000ffffffff
R13: 0000000000000000 R14: ffffed1011c7832e R15: ffff8880b3349168
refcount_dec_and_mutex_lock+0x1a/0x60 lib/refcount.c:309
nbd_put drivers/block/nbd.c:228 [inline]
nbd_config_put+0x506/0x810 drivers/block/nbd.c:1172
nbd_release+0xdf/0x150 drivers/block/nbd.c:1445
__blkdev_put+0x5aa/0x800 fs/block_dev.c:1803
blkdev_close+0x86/0xb0 fs/block_dev.c:1875
__fput+0x25f/0x7a0 fs/file_table.c:210
task_work_run+0x11f/0x190 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:191 [inline]
exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164
prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x7f66f1928270
RSP: 002b:00007ffc114d93e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000007 RCX: 00007f66f1928270
RDX: 000000000aba9500 RSI: 0000000000000000 RDI: 0000000000000007
RBP: 00007f66f27e1710 R08: 0000000000000045 R09: 0000000000000018
R10: 000055f39a88d6c8 R11: 0000000000000246 R12: 0000000000000000
R13: 000055f39a87cfd0 R14: 0000000000000003 R15: 000000000000000e
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
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 syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches
Reply all
Reply to author
Forward
0 new messages