| Title | Replies (including bot) | Last reply |
|---|---|---|
| [syzbot] possible deadlock in btrfs_lock_root_node | 0 (1) | 2022/11/02 16:19 |
syzbot |
sign-in | mailing list | source | docs |
| Title | Replies (including bot) | Last reply |
|---|---|---|
| [syzbot] possible deadlock in btrfs_lock_root_node | 0 (1) | 2022/11/02 16:19 |
loop1: detected capacity change from 0 to 32768
BTRFS info (device loop1): using sha256 (sha256-avx2) checksum algorithm
BTRFS info (device loop1): using free space tree
BTRFS info (device loop1): enabling ssd optimizations
======================================================
WARNING: possible circular locking dependency detected
6.1.0-rc6-syzkaller-00015-gc3eb11fbb826 #0 Not tainted
------------------------------------------------------
syz-executor.1/6470 is trying to acquire lock:
ffff88807671f558 (&mm->mmap_lock#2){++++}-{3:3}, at: __might_fault+0x8f/0x110 mm/memory.c:5645
but task is already holding lock:
ffff8880228a7268 (btrfs-root-00){++++}-{3:3}, at: __btrfs_tree_read_lock fs/btrfs/locking.c:134 [inline]
ffff8880228a7268 (btrfs-root-00){++++}-{3:3}, at: btrfs_tree_read_lock fs/btrfs/locking.c:140 [inline]
ffff8880228a7268 (btrfs-root-00){++++}-{3:3}, at: btrfs_read_lock_root_node+0x2b4/0x400 fs/btrfs/locking.c:279
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #5 (btrfs-root-00){++++}-{3:3}:
lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668
down_write_nested+0xa2/0x280 kernel/locking/rwsem.c:1672
__btrfs_tree_lock fs/btrfs/locking.c:196 [inline]
btrfs_tree_lock fs/btrfs/locking.c:203 [inline]
btrfs_lock_root_node+0x298/0x4b0 fs/btrfs/locking.c:256
commit_cowonly_roots+0x128/0x840 fs/btrfs/transaction.c:1266
btrfs_commit_transaction+0x1582/0x37b0 fs/btrfs/transaction.c:2376
close_ctree+0x3bb/0xc24 fs/btrfs/disk-io.c:4653
generic_shutdown_super+0x130/0x310 fs/super.c:492
kill_anon_super+0x36/0x60 fs/super.c:1086
btrfs_kill_super+0x3d/0x50 fs/btrfs/super.c:2441
deactivate_locked_super+0xa7/0xf0 fs/super.c:332
cleanup_mnt+0x494/0x520 fs/namespace.c:1186
task_work_run+0x243/0x300 kernel/task_work.c:179
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0x134/0x160 kernel/entry/common.c:171
exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:203
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:296
entry_SYSCALL_64_after_hwframe+0x63/0xcd
-> #4 (&fs_info->reloc_mutex){+.+.}-{3:3}:
lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668
__mutex_lock_common+0x1de/0x26c0 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799
btrfs_record_root_in_trans+0x153/0x180 fs/btrfs/transaction.c:484
start_transaction+0x3af/0x1180 fs/btrfs/transaction.c:721
btrfs_start_transaction fs/btrfs/transaction.c:750 [inline]
btrfs_defrag_root+0xba/0x280 fs/btrfs/transaction.c:1468
btrfs_ioctl_defrag+0x1a0/0x420 fs/btrfs/ioctl.c:3464
btrfs_ioctl+0x9f4/0xc10
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xfb/0x170 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
-> #3 (btrfs_trans_num_extwriters){++++}-{0:0}:
lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668
join_transaction+0x19f/0xe60 fs/btrfs/transaction.c:299
start_transaction+0x6fb/0x1180 fs/btrfs/transaction.c:658
btrfs_commit_super+0x9a/0xd0 fs/btrfs/disk-io.c:4496
close_ctree+0x3bb/0xc24 fs/btrfs/disk-io.c:4653
generic_shutdown_super+0x130/0x310 fs/super.c:492
kill_anon_super+0x36/0x60 fs/super.c:1086
btrfs_kill_super+0x3d/0x50 fs/btrfs/super.c:2441
deactivate_locked_super+0xa7/0xf0 fs/super.c:332
cleanup_mnt+0x494/0x520 fs/namespace.c:1186
task_work_run+0x243/0x300 kernel/task_work.c:179
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0x134/0x160 kernel/entry/common.c:171
exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:203
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:296
entry_SYSCALL_64_after_hwframe+0x63/0xcd
-> #2 (btrfs_trans_num_writers){++++}-{0:0}:
reacquire_held_locks+0x3b6/0x680 kernel/locking/lockdep.c:5193
__lock_release kernel/locking/lockdep.c:5382 [inline]
lock_release+0x304/0x870 kernel/locking/lockdep.c:5688
percpu_up_read include/linux/percpu-rwsem.h:99 [inline]
__sb_end_write include/linux/fs.h:1821 [inline]
sb_end_intwrite+0x1e/0x1a0 include/linux/fs.h:1877
__btrfs_end_transaction+0x388/0x790 fs/btrfs/transaction.c:995
btrfs_dirty_inode+0x177/0x1c0 fs/btrfs/inode.c:6099
inode_update_time fs/inode.c:1871 [inline]
__file_update_time fs/inode.c:2088 [inline]
file_update_time+0x3df/0x5d0 fs/inode.c:2119
btrfs_page_mkwrite+0x3a8/0xc80 fs/btrfs/inode.c:8431
do_page_mkwrite+0x19e/0x5e0 mm/memory.c:2978
do_shared_fault mm/memory.c:4619 [inline]
do_fault mm/memory.c:4687 [inline]
handle_pte_fault mm/memory.c:4955 [inline]
__handle_mm_fault mm/memory.c:5097 [inline]
handle_mm_fault+0x1c83/0x3660 mm/memory.c:5218
do_user_addr_fault+0x69b/0xcb0 arch/x86/mm/fault.c:1428
handle_page_fault arch/x86/mm/fault.c:1519 [inline]
exc_page_fault+0x7a/0x120 arch/x86/mm/fault.c:1575
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570
-> #1 (sb_pagefaults#3){.+.+}-{0:0}:
lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668
percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
__sb_start_write include/linux/fs.h:1826 [inline]
sb_start_pagefault include/linux/fs.h:1930 [inline]
btrfs_page_mkwrite+0x1ea/0xc80 fs/btrfs/inode.c:8415
do_page_mkwrite+0x19e/0x5e0 mm/memory.c:2978
do_shared_fault mm/memory.c:4619 [inline]
do_fault mm/memory.c:4687 [inline]
handle_pte_fault mm/memory.c:4955 [inline]
__handle_mm_fault mm/memory.c:5097 [inline]
handle_mm_fault+0x1c83/0x3660 mm/memory.c:5218
do_user_addr_fault+0x69b/0xcb0 arch/x86/mm/fault.c:1428
handle_page_fault arch/x86/mm/fault.c:1519 [inline]
exc_page_fault+0x7a/0x120 arch/x86/mm/fault.c:1575
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570
-> #0 (&mm->mmap_lock#2){++++}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3097 [inline]
check_prevs_add kernel/locking/lockdep.c:3216 [inline]
validate_chain+0x184a/0x6470 kernel/locking/lockdep.c:3831
__lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055
lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668
__might_fault+0xb2/0x110 mm/memory.c:5646
_copy_to_user+0x26/0x130 lib/usercopy.c:29
copy_to_user include/linux/uaccess.h:169 [inline]
btrfs_ioctl_get_subvol_rootref+0x8ec/0xab0 fs/btrfs/ioctl.c:3203
btrfs_ioctl+0xb7c/0xc10 fs/btrfs/ioctl.c:5556
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xfb/0x170 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
other info that might help us debug this:
Chain exists of:
&mm->mmap_lock#2 --> &fs_info->reloc_mutex --> btrfs-root-00
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(btrfs-root-00);
lock(&fs_info->reloc_mutex);
lock(btrfs-root-00);
lock(&mm->mmap_lock#2);
*** DEADLOCK ***
1 lock held by syz-executor.1/6470:
#0: ffff8880228a7268 (btrfs-root-00){++++}-{3:3}, at: __btrfs_tree_read_lock fs/btrfs/locking.c:134 [inline]
#0: ffff8880228a7268 (btrfs-root-00){++++}-{3:3}, at: btrfs_tree_read_lock fs/btrfs/locking.c:140 [inline]
#0: ffff8880228a7268 (btrfs-root-00){++++}-{3:3}, at: btrfs_read_lock_root_node+0x2b4/0x400 fs/btrfs/locking.c:279
stack backtrace:
CPU: 0 PID: 6470 Comm: syz-executor.1 Not tainted 6.1.0-rc6-syzkaller-00015-gc3eb11fbb826 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
check_noncircular+0x2f9/0x3b0 kernel/locking/lockdep.c:2177
check_prev_add kernel/locking/lockdep.c:3097 [inline]
check_prevs_add kernel/locking/lockdep.c:3216 [inline]
validate_chain+0x184a/0x6470 kernel/locking/lockdep.c:3831
__lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055
lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668
__might_fault+0xb2/0x110 mm/memory.c:5646
_copy_to_user+0x26/0x130 lib/usercopy.c:29
copy_to_user include/linux/uaccess.h:169 [inline]
btrfs_ioctl_get_subvol_rootref+0x8ec/0xab0 fs/btrfs/ioctl.c:3203
btrfs_ioctl+0xb7c/0xc10 fs/btrfs/ioctl.c:5556
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xfb/0x170 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f141e28c0d9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f141effb168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f141e3abf80 RCX: 00007f141e28c0d9
RDX: 00000000200010c0 RSI: 00000000d000943d RDI: 0000000000000004
RBP: 00007f141e2e7ae9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffe8211ebff R14: 00007f141effb300 R15: 0000000000022000
</TASK>
| Time | Kernel | Commit | Syzkaller | Config | Log | Report | Syz repro | C repro | VM info | Assets (help?) | Manager | Title |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2022/11/25 00:26 | upstream | c3eb11fbb826 | 62e26685 | .config | console log | report | info | ci-upstream-kasan-gce-smack-root | possible deadlock in btrfs_lock_root_node | |||
| 2022/11/21 01:18 | upstream | 77c51ba552a1 | 5bb70014 | .config | console log | report | info | ci2-upstream-fs | possible deadlock in btrfs_lock_root_node | |||
| 2022/11/20 20:37 | upstream | 77c51ba552a1 | 5bb70014 | .config | console log | report | info | ci2-upstream-fs | possible deadlock in btrfs_lock_root_node | |||
| 2022/11/20 16:57 | upstream | 77c51ba552a1 | 5bb70014 | .config | console log | report | info | ci2-upstream-fs | possible deadlock in btrfs_lock_root_node | |||
| 2022/11/19 08:52 | upstream | ab290eaddc4c | 5bb70014 | .config | console log | report | info | ci2-upstream-fs | possible deadlock in btrfs_lock_root_node | |||
| 2022/11/18 10:51 | upstream | 84368d882b96 | 5bb70014 | .config | console log | report | info | ci2-upstream-fs | possible deadlock in btrfs_lock_root_node | |||
| 2022/11/18 08:56 | upstream | 84368d882b96 | 5bb70014 | .config | console log | report | info | ci2-upstream-fs | possible deadlock in btrfs_lock_root_node | |||
| 2022/11/18 00:23 | upstream | 81ac25651a62 | 4ba8ab94 | .config | console log | report | info | ci2-upstream-fs | possible deadlock in btrfs_lock_root_node | |||
| 2022/11/17 19:01 | upstream | 81ac25651a62 | 4ba8ab94 | .config | console log | report | info | ci2-upstream-fs | possible deadlock in btrfs_lock_root_node | |||
| 2022/11/17 13:24 | upstream | cc675d22e422 | 3a127a31 | .config | console log | report | info | [disk image] [vmlinux] [kernel image] | ci2-upstream-fs | possible deadlock in btrfs_lock_root_node | ||
| 2022/11/17 01:52 | upstream | 59d0d52c30d4 | 3a127a31 | .config | console log | report | info | ci2-upstream-fs | possible deadlock in btrfs_lock_root_node | |||
| 2022/11/14 20:57 | upstream | 094226ad94f4 | 943f4cb8 | .config | console log | report | info | ci2-upstream-fs | possible deadlock in btrfs_lock_root_node | |||
| 2022/11/02 13:20 | git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci | bbed346d5a96 | edac4fd1 | .config | console log | report | info | [disk image] [vmlinux] | ci-upstream-gce-arm64 | possible deadlock in btrfs_lock_root_node |