syzbot


possible deadlock in __ntfs_clear_inode

Status: auto-obsoleted due to no activity on 2024/04/08 06:19
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+5ebb8d0e9b8c47867596@syzkaller.appspotmail.com
First crash: 541d, last: 110d
Discussions (10)
Title Replies (including bot) Last reply
[syzbot] Monthly ntfs report (Jan 2024) 0 (1) 2024/01/09 18:20
[syzbot] Monthly ntfs report (Dec 2023) 0 (1) 2023/12/06 10:05
[syzbot] Monthly ntfs report (Nov 2023) 0 (1) 2023/11/05 13:07
[syzbot] Monthly ntfs report (Oct 2023) 0 (1) 2023/10/04 13:13
[syzbot] Monthly ntfs report (Sep 2023) 0 (1) 2023/09/04 08:31
[syzbot] Monthly ntfs report (Aug 2023) 0 (1) 2023/08/03 07:02
[syzbot] Monthly ntfs report (Jul 2023) 0 (1) 2023/07/03 09:03
[syzbot] Monthly ntfs report (May 2023) 0 (1) 2023/05/02 07:18
[syzbot] Monthly ntfs report 0 (1) 2023/03/31 15:00
[syzbot] possible deadlock in __ntfs_clear_inode 0 (1) 2022/11/25 10:07
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 possible deadlock in __ntfs_clear_inode ntfs 2 506d 525d 0/1 upstream: reported on 2022/12/10 22:52
linux-5.15 possible deadlock in __ntfs_clear_inode 1 50d 50d 0/3 upstream: reported on 2024/03/30 00:19

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.8.0-rc1-syzkaller-00026-g7ed2632ec7d7 #0 Not tainted
------------------------------------------------------
kswapd0/87 is trying to acquire lock:
ffff888084010100 (&rl->lock){++++}-{3:3}, at: __ntfs_clear_inode+0x24/0x260 fs/ntfs/inode.c:2189

but task is already holding lock:
ffffffff8d320a00 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x160/0x1a90 mm/vmscan.c:6771

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (fs_reclaim){+.+.}-{0:0}:
       __fs_reclaim_acquire mm/page_alloc.c:3692 [inline]
       fs_reclaim_acquire+0x100/0x150 mm/page_alloc.c:3706
       might_alloc include/linux/sched/mm.h:303 [inline]
       prepare_alloc_pages.constprop.0+0x155/0x550 mm/page_alloc.c:4338
       __alloc_pages+0x193/0x2440 mm/page_alloc.c:4556
       alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133
       folio_alloc+0x1e/0xe0 mm/mempolicy.c:2211
       filemap_alloc_folio+0x3bb/0x490 mm/filemap.c:975
       do_read_cache_folio+0x1b8/0x540 mm/filemap.c:3667
       do_read_cache_page mm/filemap.c:3769 [inline]
       read_cache_page+0x5b/0x160 mm/filemap.c:3778
       read_mapping_page include/linux/pagemap.h:888 [inline]
       ntfs_map_page fs/ntfs/aops.h:75 [inline]
       map_mft_record_page fs/ntfs/mft.c:73 [inline]
       map_mft_record+0x1dd/0x730 fs/ntfs/mft.c:156
       ntfs_read_locked_inode+0x19b/0x5860 fs/ntfs/inode.c:550
       ntfs_iget+0x130/0x180 fs/ntfs/inode.c:177
       ntfs_lookup+0x312/0xc30 fs/ntfs/namei.c:117
       __lookup_slow+0x24d/0x450 fs/namei.c:1693
       lookup_slow fs/namei.c:1710 [inline]
       walk_component+0x349/0x5a0 fs/namei.c:2001
       lookup_last fs/namei.c:2458 [inline]
       path_lookupat+0x17f/0x770 fs/namei.c:2482
       filename_lookup+0x1e7/0x5b0 fs/namei.c:2511
       vfs_statx+0x13e/0x550 fs/stat.c:244
       vfs_fstatat+0xb3/0x140 fs/stat.c:304
       __do_sys_newfstatat+0x98/0x110 fs/stat.c:468
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xd3/0x250 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x63/0x6b

-> #1 (&ni->mrec_lock){+.+.}-{3:3}:
       __mutex_lock_common kernel/locking/mutex.c:608 [inline]
       __mutex_lock+0x175/0x9d0 kernel/locking/mutex.c:752
       map_mft_record+0x4a/0x730 fs/ntfs/mft.c:154
       ntfs_truncate+0x263/0x2a20 fs/ntfs/inode.c:2383
       ntfs_truncate_vfs fs/ntfs/inode.c:2864 [inline]
       ntfs_setattr+0x44d/0x640 fs/ntfs/inode.c:2916
       notify_change+0x742/0x11c0 fs/attr.c:499
       do_truncate+0x15c/0x220 fs/open.c:66
       handle_truncate fs/namei.c:3299 [inline]
       do_open fs/namei.c:3645 [inline]
       path_openat+0x24b6/0x2990 fs/namei.c:3798
       do_filp_open+0x1de/0x430 fs/namei.c:3825
       do_sys_openat2+0x176/0x1e0 fs/open.c:1404
       do_sys_open fs/open.c:1419 [inline]
       __do_sys_openat fs/open.c:1435 [inline]
       __se_sys_openat fs/open.c:1430 [inline]
       __x64_sys_openat+0x175/0x210 fs/open.c:1430
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xd3/0x250 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x63/0x6b

-> #0 (&rl->lock){++++}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3134 [inline]
       check_prevs_add kernel/locking/lockdep.c:3253 [inline]
       validate_chain kernel/locking/lockdep.c:3869 [inline]
       __lock_acquire+0x2445/0x3b30 kernel/locking/lockdep.c:5137
       lock_acquire kernel/locking/lockdep.c:5754 [inline]
       lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719
       down_write+0x3a/0x50 kernel/locking/rwsem.c:1579
       __ntfs_clear_inode+0x24/0x260 fs/ntfs/inode.c:2189
       ntfs_evict_big_inode+0x29e/0x530 fs/ntfs/inode.c:2278
       evict+0x2ed/0x6b0 fs/inode.c:665
       dispose_list+0x117/0x1e0 fs/inode.c:698
       prune_icache_sb+0xeb/0x150 fs/inode.c:883
       super_cache_scan+0x372/0x540 fs/super.c:223
       do_shrink_slab+0x428/0x1120 mm/shrinker.c:435
       shrink_slab_memcg mm/shrinker.c:548 [inline]
       shrink_slab+0xa83/0x1310 mm/shrinker.c:626
       shrink_one+0x48f/0x7b0 mm/vmscan.c:4767
       shrink_many mm/vmscan.c:4828 [inline]
       lru_gen_shrink_node mm/vmscan.c:4929 [inline]
       shrink_node+0x2149/0x3740 mm/vmscan.c:5888
       kswapd_shrink_node mm/vmscan.c:6693 [inline]
       balance_pgdat+0x9d2/0x1a90 mm/vmscan.c:6883
       kswapd+0x5be/0xbf0 mm/vmscan.c:7143
       kthread+0x2c6/0x3a0 kernel/kthread.c:388
       ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
       ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242

other info that might help us debug this:

Chain exists of:
  &rl->lock --> &ni->mrec_lock --> fs_reclaim

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(fs_reclaim);
                               lock(&ni->mrec_lock);
                               lock(fs_reclaim);
  lock(&rl->lock);

 *** DEADLOCK ***

2 locks held by kswapd0/87:
 #0: ffffffff8d320a00 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x160/0x1a90 mm/vmscan.c:6771
 #1: ffff88802ddbe0e0 (&type->s_umount_key#71){++++}-{3:3}, at: super_trylock_shared fs/super.c:566 [inline]
 #1: ffff88802ddbe0e0 (&type->s_umount_key#71){++++}-{3:3}, at: super_cache_scan+0x96/0x540 fs/super.c:196

stack backtrace:
CPU: 1 PID: 87 Comm: kswapd0 Not tainted 6.8.0-rc1-syzkaller-00026-g7ed2632ec7d7 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
 check_noncircular+0x317/0x400 kernel/locking/lockdep.c:2187
 check_prev_add kernel/locking/lockdep.c:3134 [inline]
 check_prevs_add kernel/locking/lockdep.c:3253 [inline]
 validate_chain kernel/locking/lockdep.c:3869 [inline]
 __lock_acquire+0x2445/0x3b30 kernel/locking/lockdep.c:5137
 lock_acquire kernel/locking/lockdep.c:5754 [inline]
 lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719
 down_write+0x3a/0x50 kernel/locking/rwsem.c:1579
 __ntfs_clear_inode+0x24/0x260 fs/ntfs/inode.c:2189
 ntfs_evict_big_inode+0x29e/0x530 fs/ntfs/inode.c:2278
 evict+0x2ed/0x6b0 fs/inode.c:665
 dispose_list+0x117/0x1e0 fs/inode.c:698
 prune_icache_sb+0xeb/0x150 fs/inode.c:883
 super_cache_scan+0x372/0x540 fs/super.c:223
 do_shrink_slab+0x428/0x1120 mm/shrinker.c:435
 shrink_slab_memcg mm/shrinker.c:548 [inline]
 shrink_slab+0xa83/0x1310 mm/shrinker.c:626
 shrink_one+0x48f/0x7b0 mm/vmscan.c:4767
 shrink_many mm/vmscan.c:4828 [inline]
 lru_gen_shrink_node mm/vmscan.c:4929 [inline]
 shrink_node+0x2149/0x3740 mm/vmscan.c:5888
 kswapd_shrink_node mm/vmscan.c:6693 [inline]
 balance_pgdat+0x9d2/0x1a90 mm/vmscan.c:6883
 kswapd+0x5be/0xbf0 mm/vmscan.c:7143
 kthread+0x2c6/0x3a0 kernel/kthread.c:388
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
 </TASK>

Crashes (345):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/01/24 00:09 upstream 7ed2632ec7d7 1e153dc8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in __ntfs_clear_inode
2023/12/02 10:24 upstream 815fb87b7530 f819d6f7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in __ntfs_clear_inode
2023/09/26 15:45 upstream 6465e260f487 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in __ntfs_clear_inode
2023/10/13 00:51 upstream e8c127b05766 6388bc36 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in __ntfs_clear_inode
2024/01/29 06:16 upstream 4854cf9c61d0 cc4a4020 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/28 18:12 upstream 8a696a29c690 cc4a4020 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/28 07:50 upstream 8a696a29c690 cc4a4020 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/28 03:03 upstream 8a696a29c690 cc4a4020 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/27 14:05 upstream 3a5879d495b2 cc4a4020 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/25 13:20 upstream 6098d87eaf31 1e153dc8 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/24 22:32 upstream 443b349019f2 1e153dc8 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/24 15:18 upstream 615d30064886 1e153dc8 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/23 13:41 upstream 7ed2632ec7d7 74d5594c .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/23 07:24 upstream 610347effc2e 1c0ecc51 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/21 10:57 upstream 7a396820222d 9bd8dcda .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/21 05:51 upstream 125514880ddd 9bd8dcda .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/19 16:33 upstream 9d1694dc91ce 9bd8dcda .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/19 02:58 upstream b0d326da462e 21772ce4 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/18 03:17 upstream 1b1934dbbdcf 915053c7 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/08 09:51 upstream 0dd3ee311255 d0304e9c .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/04 01:41 upstream ac865f00af29 28c42cff .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/03 18:14 upstream 610a9b8f49fb 28c42cff .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2024/01/01 11:55 upstream 610a9b8f49fb fb427a07 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/31 22:38 upstream 2639772a11c8 fb427a07 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/31 04:37 upstream 453f5db0619e fb427a07 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/30 20:46 upstream f016f7547aee fb427a07 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/29 01:20 upstream 505e701c0b2c fb427a07 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/28 11:11 upstream f5837722ffec fb427a07 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/28 04:06 upstream f5837722ffec fb427a07 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/27 07:21 upstream fbafc3e621c3 fb427a07 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/26 11:20 upstream fbafc3e621c3 fb427a07 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/24 12:02 upstream 861deac3b092 fb427a07 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/23 17:14 upstream 5254c0cbc92d fb427a07 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/22 20:10 upstream 8afe6f0e0e25 fb427a07 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/21 23:43 upstream a4aebe936554 4f9530a3 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/19 23:51 upstream 55cb5f43689d 3ad490ea .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/19 17:47 upstream 2cf4f94d8e86 3ad490ea .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/17 17:04 upstream 3b8a9b2e6809 3222d10c .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/17 07:49 upstream 3b8a9b2e6809 3222d10c .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/16 20:49 upstream c8e97fc6b4c0 3222d10c .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/16 03:18 upstream 3bd7d7488169 3222d10c .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/15 09:28 upstream c7402612e2e6 3222d10c .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/15 00:24 upstream c7402612e2e6 3222d10c .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/13 21:44 upstream 5bd7ef53ffe5 ce0359fb .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/13 14:46 upstream 88035e5694a8 ebcad15c .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/13 07:04 upstream eaadbbaaff74 ebcad15c .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/09 03:30 upstream f2e8a57ee903 28b24332 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/06 22:03 upstream bee0e7762ad2 95293603 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/12/05 14:26 upstream bee0e7762ad2 858d62d1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __ntfs_clear_inode
2023/04/13 06:50 upstream 0bcc40255504 82d5e53e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in __ntfs_clear_inode
2022/11/24 19:57 upstream 4312098baf37 ff68ff8f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in __ntfs_clear_inode
2023/02/24 08:09 linux-next 0222aa9800b2 9e2ebb3c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in __ntfs_clear_inode
* Struck through repros no longer work on HEAD.