Hello,
syzbot found the following issue on:
HEAD commit: c4215ee4771b Linux 4.14.302
git tree: linux-4.14.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=1778d2ac480000
kernel config:
https://syzkaller.appspot.com/x/.config?x=4a9988fe055c9527
dashboard link:
https://syzkaller.appspot.com/bug?extid=5f0cb326a365dd7d0ea1
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/c93ba055d204/disk-c4215ee4.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/bfbc929a33c1/vmlinux-c4215ee4.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/444658051770/bzImage-c4215ee4.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+5f0cb3...@syzkaller.appspotmail.com
BTRFS info (device loop2): using free space tree
BTRFS info (device loop2): has skinny extents
usb usb9: usbfs: interface 0 claimed by hub while 'syz-executor.5' sets config #1
======================================================
WARNING: possible circular locking dependency detected
4.14.302-syzkaller #0 Not tainted
------------------------------------------------------
kworker/u4:3/668 is trying to acquire lock:
(sb_internal#2){.+.+}, at: [<ffffffff829edf5e>] sb_start_intwrite include/linux/fs.h:1598 [inline]
(sb_internal#2){.+.+}, at: [<ffffffff829edf5e>] start_transaction+0x6de/0xf30 fs/btrfs/transaction.c:548
but task is already holding lock:
((&work->normal_work)){+.+.}, at: [<ffffffff81366166>] process_one_work+0x6e6/0x14a0 kernel/workqueue.c:2092
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #4 ((&work->normal_work)){+.+.}:
process_one_work+0x736/0x14a0 kernel/workqueue.c:2093
worker_thread+0x5cc/0xff0 kernel/workqueue.c:2251
kthread+0x30d/0x420 kernel/kthread.c:232
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406
-> #3 ("%s-%s""btrfs", name){+.+.}:
flush_workqueue+0xfa/0x1310 kernel/workqueue.c:2625
drain_workqueue+0x177/0x3e0 kernel/workqueue.c:2790
destroy_workqueue+0x71/0x710 kernel/workqueue.c:4116
__btrfs_destroy_workqueue fs/btrfs/async-thread.c:436 [inline]
btrfs_destroy_workqueue+0xf8/0x630 fs/btrfs/async-thread.c:447
scrub_workers_put+0x90/0x1a0 fs/btrfs/scrub.c:4075
btrfs_scrub_dev+0x536/0xcd0 fs/btrfs/scrub.c:4219
btrfs_ioctl_scrub fs/btrfs/ioctl.c:4451 [inline]
btrfs_ioctl+0xba8/0x5b20 fs/btrfs/ioctl.c:5681
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:500 [inline]
do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684
SYSC_ioctl fs/ioctl.c:701 [inline]
SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x5e/0xd3
-> #2 (&fs_info->scrub_lock){+.+.}:
__mutex_lock_common kernel/locking/mutex.c:756 [inline]
__mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893
btrfs_scrub_dev+0x1f3/0xcd0 fs/btrfs/scrub.c:4150
btrfs_ioctl_scrub fs/btrfs/ioctl.c:4451 [inline]
btrfs_ioctl+0xba8/0x5b20 fs/btrfs/ioctl.c:5681
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:500 [inline]
do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684
SYSC_ioctl fs/ioctl.c:701 [inline]
SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x5e/0xd3
-> #1 (&fs_devs->device_list_mutex){+.+.}:
__mutex_lock_common kernel/locking/mutex.c:756 [inline]
__mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893
btrfs_finish_chunk_alloc+0x221/0xe90 fs/btrfs/volumes.c:4923
btrfs_create_pending_block_groups+0x1fd/0x540 fs/btrfs/extent-tree.c:10388
__btrfs_end_transaction+0x1f2/0xaa0 fs/btrfs/transaction.c:851
flush_space+0x8de/0xde0 fs/btrfs/extent-tree.c:5046
btrfs_async_reclaim_metadata_space+0x414/0xc20 fs/btrfs/extent-tree.c:5162
process_one_work+0x793/0x14a0 kernel/workqueue.c:2117
worker_thread+0x5cc/0xff0 kernel/workqueue.c:2251
kthread+0x30d/0x420 kernel/kthread.c:232
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406
-> #0 (sb_internal#2){.+.+}:
lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline]
percpu_down_read include/linux/percpu-rwsem.h:59 [inline]
__sb_start_write+0x64/0x260 fs/super.c:1342
sb_start_intwrite include/linux/fs.h:1598 [inline]
start_transaction+0x6de/0xf30 fs/btrfs/transaction.c:548
btrfs_qgroup_rescan_worker+0x176/0x1060 fs/btrfs/qgroup.c:2632
normal_work_helper+0x304/0x1330 fs/btrfs/async-thread.c:376
process_one_work+0x793/0x14a0 kernel/workqueue.c:2117
worker_thread+0x5cc/0xff0 kernel/workqueue.c:2251
kthread+0x30d/0x420 kernel/kthread.c:232
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406
other info that might help us debug this:
Chain exists of:
sb_internal#2 --> "%s-%s""btrfs", name --> (&work->normal_work)
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock((&work->normal_work));
lock("%s-%s""btrfs", name);
lock((&work->normal_work));
lock(sb_internal#2);
*** DEADLOCK ***
2 locks held by kworker/u4:3/668:
#0: ("%s-%s""btrfs", name){+.+.}, at: [<ffffffff81366130>] process_one_work+0x6b0/0x14a0 kernel/workqueue.c:2088
#1: ((&work->normal_work)){+.+.}, at: [<ffffffff81366166>] process_one_work+0x6e6/0x14a0 kernel/workqueue.c:2092
stack backtrace:
CPU: 0 PID: 668 Comm: kworker/u4:3 Not tainted 4.14.302-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Workqueue: btrfs-qgroup-rescan btrfs_qgroup_rescan_helper
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x1b2/0x281 lib/dump_stack.c:58
print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1258
check_prev_add kernel/locking/lockdep.c:1905 [inline]
check_prevs_add kernel/locking/lockdep.c:2022 [inline]
validate_chain kernel/locking/lockdep.c:2464 [inline]
__lock_acquire+0x2e0e/0x3f20 kernel/locking/lockdep.c:3491
lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline]
percpu_down_read include/linux/percpu-rwsem.h:59 [inline]
__sb_start_write+0x64/0x260 fs/super.c:1342
sb_start_intwrite include/linux/fs.h:1598 [inline]
start_transaction+0x6de/0xf30 fs/btrfs/transaction.c:548
btrfs_qgroup_rescan_worker+0x176/0x1060 fs/btrfs/qgroup.c:2632
normal_work_helper+0x304/0x1330 fs/btrfs/async-thread.c:376
process_one_work+0x793/0x14a0 kernel/workqueue.c:2117
worker_thread+0x5cc/0xff0 kernel/workqueue.c:2251
kthread+0x30d/0x420 kernel/kthread.c:232
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406
BTRFS error (device loop2): fail to start transaction for status update: -28
usb usb9: usbfs: interface 0 claimed by hub while 'syz-executor.5' sets config #0
usb usb9: usbfs: interface 0 claimed by usbfs while 'syz-executor.5' sets config #1
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
caif:caif_disconnect_client(): nothing to disconnect
chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT
chnl_net:chnl_net_open(): state disconnected
A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check.
hub 9-0:1.0: USB hub found
hub 9-0:1.0: 8 ports detected
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
caif:caif_disconnect_client(): nothing to disconnect
chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT
chnl_net:chnl_net_open(): state disconnected
A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check.
BTRFS info (device loop2): using free space tree
BTRFS info (device loop2): has skinny extents
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
caif:caif_disconnect_client(): nothing to disconnect
chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT
chnl_net:chnl_net_open(): state disconnected
A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check.
BTRFS error (device loop2): fail to start transaction for status update: -28
usb usb9: usbfs: interface 0 claimed by hub while 'syz-executor.5' sets config #0
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19
caif:caif_disconnect_client(): nothing to disconnect
chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT
chnl_net:chnl_net_open(): state disconnected
A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check.
usb usb9: usbfs: interface 0 claimed by hub while 'syz-executor.5' sets config #1
kauditd_printk_skb: 2 callbacks suppressed
audit: type=1800 audit(1672167832.696:22): pid=10335 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.5" name="file0" dev="sda1" ino=13969 res=0
audit: type=1804 audit(1672167832.706:23): pid=10335 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.5" name="/root/syzkaller-testdir1613836640/syzkaller.LX5S6F/23/file0" dev="sda1" ino=13969 res=1
BTRFS info (device loop2): using free space tree
BTRFS info (device loop2): has skinny extents
audit: type=1804 audit(1672167832.706:24): pid=10335 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.5" name="/root/syzkaller-testdir1613836640/syzkaller.LX5S6F/23/file0" dev="sda1" ino=13969 res=1
BTRFS error (device loop2): fail to start transaction for status update: -28
audit: type=1800 audit(1672167833.566:25): pid=10409 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.5" name="file0" dev="sda1" ino=13978 res=0
audit: type=1804 audit(1672167833.576:26): pid=10409 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.5" name="/root/syzkaller-testdir1613836640/syzkaller.LX5S6F/24/file0" dev="sda1" ino=13978 res=1
audit: type=1804 audit(1672167833.576:27): pid=10409 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.5" name="/root/syzkaller-testdir1613836640/syzkaller.LX5S6F/24/file0" dev="sda1" ino=13978 res=1
BTRFS info (device loop2): using free space tree
BTRFS info (device loop2): has skinny extents
======================================================
WARNING: the mand mount option is being deprecated and
will be removed in v5.15!
======================================================
F2FS-fs (loop0): invalid crc value
F2FS-fs (loop0): Found nat_bits in checkpoint
F2FS-fs (loop0): Mounted with checkpoint version = 48b305e4
audit: type=1800 audit(1672167835.426:28): pid=10478 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.5" name="file0" dev="sda1" ino=13981 res=0
BTRFS error (device loop2): fail to start transaction for status update: -28
audit: type=1800 audit(1672167835.426:29): pid=10479 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.4" name="file0" dev="sda1" ino=13982 res=0
audit: type=1804 audit(1672167835.626:30): pid=10478 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.5" name="/root/syzkaller-testdir1613836640/syzkaller.LX5S6F/25/file0" dev="sda1" ino=13981 res=1
audit: type=1804 audit(1672167835.626:31): pid=10479 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.4" name="/root/syzkaller-testdir161041830/syzkaller.mF4tZ6/31/file0" dev="sda1" ino=13982 res=1
---
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.