syzbot


possible deadlock in ntfs_read_folio

Status: upstream: reported C repro on 2023/03/14 17:51
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+784ba1c5dff60f10674b@syzkaller.appspotmail.com
First crash: 579d, last: 4d06h
Bug presence (3)
Date Name Commit Repro Result
2024/04/26 linux-6.1.y (ToT) 6741e066ec76 C [report] possible deadlock in ntfs_read_folio
2023/12/29 upstream (ToT) 8735c7c84d1b C [report] possible deadlock in ntfs_read_folio
2024/04/26 upstream (ToT) c942a0cd3603 C Didn't crash
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in ntfs_read_folio ntfs3 C inconclusive done 5525 3d22h 743d 0/28 upstream: reported C repro on 2022/10/01 13:48
Fix bisection attempts (1)
Created Duration User Patch Repo Result
2024/05/02 01:29 8h34m fix candidate upstream OK (1) job log

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.1.90-syzkaller #0 Not tainted
------------------------------------------------------
kworker/u4:1/11 is trying to acquire lock:
ffff888073ff8940 (&rl->lock){++++}-{3:3}, at: ntfs_read_block fs/ntfs/aops.c:248 [inline]
ffff888073ff8940 (&rl->lock){++++}-{3:3}, at: ntfs_read_folio+0x14c9/0x29d0 fs/ntfs/aops.c:436

but task is already holding lock:
ffff888070c31210 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x48/0x630 fs/ntfs/mft.c:154

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&ni->mrec_lock){+.+.}-{3:3}:
       lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747
       map_mft_record+0x48/0x630 fs/ntfs/mft.c:154
       ntfs_attr_extend_allocation+0x535/0x4340 fs/ntfs/attrib.c:2002
       ntfs_prepare_file_for_write fs/ntfs/file.c:391 [inline]
       ntfs_file_write_iter+0x3a9/0x19f0 fs/ntfs/file.c:1915
       call_write_iter include/linux/fs.h:2265 [inline]
       new_sync_write fs/read_write.c:491 [inline]
       vfs_write+0x7ae/0xba0 fs/read_write.c:584
       ksys_write+0x19c/0x2c0 fs/read_write.c:637
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (&rl->lock){++++}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3090 [inline]
       check_prevs_add kernel/locking/lockdep.c:3209 [inline]
       validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825
       __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
       lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
       down_read+0xad/0xa30 kernel/locking/rwsem.c:1520
       ntfs_read_block fs/ntfs/aops.c:248 [inline]
       ntfs_read_folio+0x14c9/0x29d0 fs/ntfs/aops.c:436
       filemap_read_folio+0x199/0x780 mm/filemap.c:2461
       do_read_cache_folio+0x2ee/0x810 mm/filemap.c:3598
       do_read_cache_page+0x32/0x220 mm/filemap.c:3640
       read_mapping_page include/linux/pagemap.h:791 [inline]
       ntfs_map_page fs/ntfs/aops.h:75 [inline]
       ntfs_sync_mft_mirror+0x25b/0x1ad0 fs/ntfs/mft.c:480
       write_mft_record_nolock+0x1151/0x18d0 fs/ntfs/mft.c:787
       write_mft_record+0x149/0x310 fs/ntfs/mft.h:95
       __ntfs_write_inode+0x6ff/0xbb0 fs/ntfs/inode.c:3050
       write_inode fs/fs-writeback.c:1460 [inline]
       __writeback_single_inode+0x67d/0x11e0 fs/fs-writeback.c:1677
       writeback_sb_inodes+0xc2b/0x1b20 fs/fs-writeback.c:1903
       wb_writeback+0x49d/0xe10 fs/fs-writeback.c:2077
       wb_do_writeback fs/fs-writeback.c:2220 [inline]
       wb_workfn+0x427/0x1020 fs/fs-writeback.c:2260
       process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
       worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
       kthread+0x28d/0x320 kernel/kthread.c:376
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308

other info that might help us debug this:

 Possible unsafe locking scenario:

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

 *** DEADLOCK ***

3 locks held by kworker/u4:1/11:
 #0: ffff88814329e938 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #1: ffffc90000107d20 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #2: ffff888070c31210 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x48/0x630 fs/ntfs/mft.c:154

stack backtrace:
CPU: 0 PID: 11 Comm: kworker/u4:1 Not tainted 6.1.90-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Workqueue: writeback wb_workfn (flush-7:0)
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2170
 check_prev_add kernel/locking/lockdep.c:3090 [inline]
 check_prevs_add kernel/locking/lockdep.c:3209 [inline]
 validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825
 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
 down_read+0xad/0xa30 kernel/locking/rwsem.c:1520
 ntfs_read_block fs/ntfs/aops.c:248 [inline]
 ntfs_read_folio+0x14c9/0x29d0 fs/ntfs/aops.c:436
 filemap_read_folio+0x199/0x780 mm/filemap.c:2461
 do_read_cache_folio+0x2ee/0x810 mm/filemap.c:3598
 do_read_cache_page+0x32/0x220 mm/filemap.c:3640
 read_mapping_page include/linux/pagemap.h:791 [inline]
 ntfs_map_page fs/ntfs/aops.h:75 [inline]
 ntfs_sync_mft_mirror+0x25b/0x1ad0 fs/ntfs/mft.c:480
 write_mft_record_nolock+0x1151/0x18d0 fs/ntfs/mft.c:787
 write_mft_record+0x149/0x310 fs/ntfs/mft.h:95
 __ntfs_write_inode+0x6ff/0xbb0 fs/ntfs/inode.c:3050
 write_inode fs/fs-writeback.c:1460 [inline]
 __writeback_single_inode+0x67d/0x11e0 fs/fs-writeback.c:1677
 writeback_sb_inodes+0xc2b/0x1b20 fs/fs-writeback.c:1903
 wb_writeback+0x49d/0xe10 fs/fs-writeback.c:2077
 wb_do_writeback fs/fs-writeback.c:2220 [inline]
 wb_workfn+0x427/0x1020 fs/fs-writeback.c:2260
 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292

Crashes (119):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/05 12:08 linux-6.1.y 909ba1f1b414 610f2a54 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2024/05/05 06:35 linux-6.1.y 909ba1f1b414 610f2a54 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2024/04/26 21:07 linux-6.1.y 6741e066ec76 059e9963 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/12/29 06:20 linux-6.1.y 4aa6747d9352 fb427a07 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2024/06/10 11:48 linux-6.1.y 88690811da69 82c05ab8 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2024/04/25 09:06 linux-6.1.y 6741e066ec76 8bdc0f22 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2024/03/31 22:00 linux-6.1.y e5cd595e23c1 6baf5069 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2024/03/30 23:54 linux-6.1.y e5cd595e23c1 6baf5069 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2024/03/30 13:41 linux-6.1.y e5cd595e23c1 6baf5069 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2024/02/29 12:09 linux-6.1.y 81e1dc2f7001 352ab904 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2024/02/24 22:38 linux-6.1.y 81e1dc2f7001 8d446f15 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2024/01/12 06:49 linux-6.1.y 7c58bfa711cb dda5a988 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2023/11/26 07:51 linux-6.1.y 69e434a1cb21 5b429f39 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2023/11/21 03:01 linux-6.1.y 69e434a1cb21 cb976f63 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2023/11/16 12:30 linux-6.1.y fb2635ac69ab cb976f63 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2023/03/24 11:45 linux-6.1.y e3a87a10f259 f94b4a29 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2023/08/13 13:09 linux-6.1.y 1321ab403b38 39990d51 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/08/01 10:09 linux-6.1.y d2a6dc4eaf6d 2a0d0f29 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/05/28 18:18 linux-6.1.y a343b0dd87b4 cf184559 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/05/22 06:30 linux-6.1.y fa74641fb6b9 4bce1a3e .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/05/07 16:42 linux-6.1.y ca48fc16c493 90c93c40 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2024/09/09 22:14 linux-6.1.y 5ca5b389fddf 073f8be2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2024/08/23 15:33 linux-6.1.y ee5e09825b81 d7d32352 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2024/07/11 20:31 linux-6.1.y 266ee8e06d5b eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2024/04/24 05:33 linux-6.1.y 6741e066ec76 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2024/01/30 00:59 linux-6.1.y 883d1a956208 991a98f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2024/01/23 23:50 linux-6.1.y 8fd7f4462453 1e153dc8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2024/01/19 09:58 linux-6.1.y fec3b1451d5f 21772ce4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2024/01/16 22:35 linux-6.1.y fec3b1451d5f 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2024/01/04 19:07 linux-6.1.y a507f147e6f0 28c42cff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/12/29 11:57 linux-6.1.y 4aa6747d9352 fb427a07 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/12/20 07:35 linux-6.1.y ba6f5fb46511 3ad490ea .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/12/19 16:48 linux-6.1.y ba6f5fb46511 3ad490ea .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/12/19 04:43 linux-6.1.y ba6f5fb46511 924661f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/12/18 03:04 linux-6.1.y ba6f5fb46511 3222d10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/12/17 08:19 linux-6.1.y ba6f5fb46511 3222d10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/12/16 21:07 linux-6.1.y ba6f5fb46511 3222d10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/12/07 03:26 linux-6.1.y c6114c845984 e3299f55 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/12/05 02:09 linux-6.1.y c6114c845984 f819d6f7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/11/30 17:41 linux-6.1.y 6ac30d748bb0 f819d6f7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/11/27 09:50 linux-6.1.y 69e434a1cb21 5b429f39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/11/26 19:57 linux-6.1.y 69e434a1cb21 5b429f39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/11/26 12:50 linux-6.1.y 69e434a1cb21 5b429f39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/11/22 11:17 linux-6.1.y 69e434a1cb21 cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/11/20 08:04 linux-6.1.y fb2635ac69ab cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/11/18 18:53 linux-6.1.y fb2635ac69ab cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/11/14 18:37 linux-6.1.y fb2635ac69ab cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/10/26 01:04 linux-6.1.y 32c9cdbe383c 72e794c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/10/09 01:19 linux-6.1.y ecda77b46871 5e837c76 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/10/07 01:57 linux-6.1.y ecda77b46871 ea12a918 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2023/10/01 19:35 linux-6.1.y d23900f974e0 8e26a358 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
2024/10/09 13:29 linux-6.1.y aa4cd140bba5 56fb2cb7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2024/09/28 11:17 linux-6.1.y e526b12bf916 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2024/04/10 08:28 linux-6.1.y 347385861c50 171ec371 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2024/04/07 05:16 linux-6.1.y 347385861c50 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2024/03/28 22:10 linux-6.1.y e5cd595e23c1 e91187ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2024/03/15 22:09 linux-6.1.y d7543167affd d615901c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2024/02/16 21:53 linux-6.1.y 8b4118fabd6e 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2024/02/08 08:28 linux-6.1.y f1bb70486c9c 6404acf9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2024/01/13 13:16 linux-6.1.y 7c58bfa711cb 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2023/12/01 14:49 linux-6.1.y 6ac30d748bb0 f819d6f7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2023/11/30 10:35 linux-6.1.y 6ac30d748bb0 f819d6f7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2023/11/21 02:19 linux-6.1.y 69e434a1cb21 cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2023/11/11 07:34 linux-6.1.y fb2635ac69ab d80eec66 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2023/10/28 12:39 linux-6.1.y 32c9cdbe383c 3c418d72 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2023/10/23 23:33 linux-6.1.y 7d24402875c7 989a3687 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_read_folio
2023/03/14 17:51 linux-6.1.y 6449a0ba6843 0d5c4377 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_read_folio
* Struck through repros no longer work on HEAD.