NTFS3 file system kernel mode driver
 help / color / mirror / Atom feed
From: syzbot <syzbot+cfc6e8106bec1c524f7d@syzkaller.appspotmail.com>
To: almaz.alexandrovich@paragon-software.com,
	linux-kernel@vger.kernel.org,  ntfs3@lists.linux.dev,
	syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [ntfs3?] possible deadlock in ntfs_readdir
Date: Sat, 01 Aug 2026 20:39:21 -0700	[thread overview]
Message-ID: <6a6ebbe9.f794c993.27aeb.001b.GAE@google.com> (raw)
In-Reply-To: <6a42cfca.9dc7bc9d.3393b4.0008.GAE@google.com>

syzbot has found a reproducer for the following issue on:

HEAD commit:    02dc699f83d0 Merge tag 'kbuild-fixes-7.2-1' of git://git.k..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=13141e32580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=cb17729fb04b1e3a
dashboard link: https://syzkaller.appspot.com/bug?extid=cfc6e8106bec1c524f7d
compiler:       Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=107a8db9580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/f25ce3963d3a/disk-02dc699f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/df741cd52af8/vmlinux-02dc699f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/4a5eab9ecee0/bzImage-02dc699f.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/bb354ea60a0b/mount_0.gz

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

======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.1.223/6607 is trying to acquire lock:
ffff88803bfcc7b0 (&mm->mmap_lock){++++}-{4:4}, at: mmap_read_lock_killable+0x1d/0x70 include/linux/mmap_lock.h:601

but task is already holding lock:
ffff888060abd478 (&ni->ni_lock/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1222 [inline]
ffff888060abd478 (&ni->ni_lock/5){+.+.}-{4:4}, at: ntfs_readdir+0x752/0xec0 fs/ntfs3/dir.c:499

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&ni->ni_lock/5){+.+.}-{4:4}:
       __mutex_lock_common kernel/locking/rtmutex_api.c:559 [inline]
       mutex_lock_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:578
       ni_lock fs/ntfs3/ntfs_fs.h:1222 [inline]
       attr_data_get_block+0x1bf/0x2a0 fs/ntfs3/attrib.c:976
       ntfs_file_mmap_prepare+0x5b3/0xa20 fs/ntfs3/file.c:430
       vfs_mmap_prepare include/linux/fs.h:2071 [inline]
       call_mmap_prepare mm/vma.c:2672 [inline]
       __mmap_region mm/vma.c:2758 [inline]
       mmap_region+0xe78/0x2310 mm/vma.c:2860
       do_mmap+0xc1e/0x10b0 mm/mmap.c:560
       vm_mmap_pgoff+0x275/0x4e0 mm/util.c:581
       ksys_mmap_pgoff+0x4a6/0x720 mm/mmap.c:606
       do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
       do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (&mm->mmap_lock){++++}-{4:4}:
       check_prev_add kernel/locking/lockdep.c:3165 [inline]
       check_prevs_add kernel/locking/lockdep.c:3284 [inline]
       validate_chain kernel/locking/lockdep.c:3908 [inline]
       __lock_acquire+0x1520/0x2ce0 kernel/locking/lockdep.c:5237
       lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5868
       down_read_killable+0xa4/0x220 kernel/locking/rwsem.c:1599
       mmap_read_lock_killable+0x1d/0x70 include/linux/mmap_lock.h:601
       get_mmap_lock_carefully mm/mmap_lock.c:450 [inline]
       lock_mm_and_find_vma+0x2d6/0x340 mm/mmap_lock.c:501
       do_user_addr_fault+0x341/0x1340 arch/x86/mm/fault.c:1366
       handle_page_fault arch/x86/mm/fault.c:1483 [inline]
       exc_page_fault+0x6a/0xc0 arch/x86/mm/fault.c:1536
       asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:595
       filldir+0x2bd/0x630 fs/readdir.c:-1
       dir_emit include/linux/fs.h:3587 [inline]
       ntfs_dir_emit fs/ntfs3/dir.c:346 [inline]
       ntfs_read_hdr+0x8a4/0xc10 fs/ntfs3/dir.c:387
       ntfs_readdir+0x9ea/0xec0 fs/ntfs3/dir.c:547
       iterate_dir+0x2f1/0x4e0 fs/readdir.c:110
       __do_sys_getdents fs/readdir.c:319 [inline]
       __se_sys_getdents+0xf1/0x270 fs/readdir.c:304
       do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
       do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&ni->ni_lock/5);
                               lock(&mm->mmap_lock);
                               lock(&ni->ni_lock/5);
  rlock(&mm->mmap_lock);

 *** DEADLOCK ***

3 locks held by syz.1.223/6607:
 #0: ffff888031b34728 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x252/0x320 fs/file.c:1259
 #1: ffff888060abd730 (&type->i_mutex_dir_key#8){++++}-{4:4}, at: iterate_dir+0x215/0x4e0 fs/readdir.c:103
 #2: ffff888060abd478 (&ni->ni_lock/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1222 [inline]
 #2: ffff888060abd478 (&ni->ni_lock/5){+.+.}-{4:4}, at: ntfs_readdir+0x752/0xec0 fs/ntfs3/dir.c:499

stack backtrace:
CPU: 1 UID: 0 PID: 6607 Comm: syz.1.223 Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 print_circular_bug+0x2e1/0x300 kernel/locking/lockdep.c:2043
 check_noncircular+0x12e/0x150 kernel/locking/lockdep.c:2175
 check_prev_add kernel/locking/lockdep.c:3165 [inline]
 check_prevs_add kernel/locking/lockdep.c:3284 [inline]
 validate_chain kernel/locking/lockdep.c:3908 [inline]
 __lock_acquire+0x1520/0x2ce0 kernel/locking/lockdep.c:5237
 lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5868
 down_read_killable+0xa4/0x220 kernel/locking/rwsem.c:1599
 mmap_read_lock_killable+0x1d/0x70 include/linux/mmap_lock.h:601
 get_mmap_lock_carefully mm/mmap_lock.c:450 [inline]
 lock_mm_and_find_vma+0x2d6/0x340 mm/mmap_lock.c:501
 do_user_addr_fault+0x341/0x1340 arch/x86/mm/fault.c:1366
 handle_page_fault arch/x86/mm/fault.c:1483 [inline]
 exc_page_fault+0x6a/0xc0 arch/x86/mm/fault.c:1536
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:595
RIP: 0010:filldir+0x2bd/0x630 fs/readdir.c:290
Code: b9 99 82 ff 0f 01 cb 48 8b 44 24 20 49 89 47 08 48 bd 00 00 00 00 00 fc ff df 48 8b 44 24 40 48 89 03 8b 4c 24 04 48 8d 43 10 <66> 89 08 8b 54 24 14 80 e2 0f 89 c9 48 8d 04 0b 48 ff c8 88 10 48
RSP: 0018:ffffc9000553fab0 EFLAGS: 00050293
RAX: 0000200000002000 RBX: 0000200000001ff0 RCX: 0000000000000020
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000007
RBP: dffffc0000000000 R08: 0000000000000000 R09: 0000000000000000
R10: dffffc0000000000 R11: ffffed10052c57c1 R12: ffff88805e062000
R13: 0000000000000005 R14: 0000000000000005 R15: 0000200000001fd8
 dir_emit include/linux/fs.h:3587 [inline]
 ntfs_dir_emit fs/ntfs3/dir.c:346 [inline]
 ntfs_read_hdr+0x8a4/0xc10 fs/ntfs3/dir.c:387
 ntfs_readdir+0x9ea/0xec0 fs/ntfs3/dir.c:547
 iterate_dir+0x2f1/0x4e0 fs/readdir.c:110
 __do_sys_getdents fs/readdir.c:319 [inline]
 __se_sys_getdents+0xf1/0x270 fs/readdir.c:304
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f3850c8e019
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f38502ee028 EFLAGS: 00000246 ORIG_RAX: 000000000000004e
RAX: ffffffffffffffda RBX: 00007f3850f15fa0 RCX: 00007f3850c8e019
RDX: 00000000000000b8 RSI: 0000200000001fc0 RDI: 0000000000000007
RBP: 00007f3850d2500c R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f3850f16038 R14: 00007f3850f15fa0 R15: 00007ffe64cebd08
 </TASK>
ntfs3(loop1): failed to convert "0080" to macinuit
ntfs3(loop1): failed to convert name for inode 1e.
ntfs3(loop1): ino=1f, mi_enum_attr
----------------
Code disassembly (best guess):
   0:	b9 99 82 ff 0f       	mov    $0xfff8299,%ecx
   5:	01 cb                	add    %ecx,%ebx
   7:	48 8b 44 24 20       	mov    0x20(%rsp),%rax
   c:	49 89 47 08          	mov    %rax,0x8(%r15)
  10:	48 bd 00 00 00 00 00 	movabs $0xdffffc0000000000,%rbp
  17:	fc ff df
  1a:	48 8b 44 24 40       	mov    0x40(%rsp),%rax
  1f:	48 89 03             	mov    %rax,(%rbx)
  22:	8b 4c 24 04          	mov    0x4(%rsp),%ecx
  26:	48 8d 43 10          	lea    0x10(%rbx),%rax
* 2a:	66 89 08             	mov    %cx,(%rax) <-- trapping instruction
  2d:	8b 54 24 14          	mov    0x14(%rsp),%edx
  31:	80 e2 0f             	and    $0xf,%dl
  34:	89 c9                	mov    %ecx,%ecx
  36:	48 8d 04 0b          	lea    (%rbx,%rcx,1),%rax
  3a:	48 ff c8             	dec    %rax
  3d:	88 10                	mov    %dl,(%rax)
  3f:	48                   	rex.W


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

      reply	other threads:[~2026-08-02  3:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29 20:04 [syzbot] [ntfs3?] possible deadlock in ntfs_readdir syzbot
2026-08-02  3:39 ` syzbot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a6ebbe9.f794c993.27aeb.001b.GAE@google.com \
    --to=syzbot+cfc6e8106bec1c524f7d@syzkaller.appspotmail.com \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntfs3@lists.linux.dev \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox