[v6.1] possible deadlock in __blockdev_direct_IO (3)

3 views
Skip to first unread message

syzbot

unread,
Jun 4, 2025, 2:06:32 PM6/4/25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 58485ff1a74f Linux 6.1.141
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=131da570580000
kernel config: https://syzkaller.appspot.com/x/.config?x=d93c21c25e641edc
dashboard link: https://syzkaller.appspot.com/bug?extid=0ea7726a3b02aed0b078
compiler: Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/13b062afcec7/disk-58485ff1.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/fdd4e489be2a/vmlinux-58485ff1.xz
kernel image: https://storage.googleapis.com/syzbot-assets/08bebb6045ec/Image-58485ff1.gz.xz

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

======================================================
WARNING: possible circular locking dependency detected
6.1.141-syzkaller #0 Not tainted
------------------------------------------------------
syz.1.645/6328 is trying to acquire lock:
ffff0000d59fa548 (&mm->mmap_lock){++++}-{3:3}, at: get_current arch/arm64/include/asm/current.h:19 [inline]
ffff0000d59fa548 (&mm->mmap_lock){++++}-{3:3}, at: internal_get_user_pages_fast+0x120/0x1a70 mm/gup.c:3042

but task is already holding lock:
ffff0000e38ae380 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
ffff0000e38ae380 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: __blockdev_direct_IO+0x2c8/0x318c fs/direct-io.c:1162

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}:
down_write+0x5c/0x88 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:758 [inline]
ntfs_file_mmap+0x3e8/0x55c fs/ntfs3/file.c:320
call_mmap include/linux/fs.h:2270 [inline]
mmap_file+0x6c/0xc8 mm/util.c:1109
__mmap_region mm/mmap.c:2760 [inline]
mmap_region+0xcc8/0x1860 mm/mmap.c:2904
do_mmap+0x978/0x10dc mm/mmap.c:1424
vm_mmap_pgoff+0x184/0x284 mm/util.c:520
ksys_mmap_pgoff+0x3b8/0x5a0 mm/mmap.c:1470
__do_sys_mmap arch/arm64/kernel/sys.c:28 [inline]
__se_sys_mmap arch/arm64/kernel/sys.c:21 [inline]
__arm64_sys_mmap+0xf8/0x110 arch/arm64/kernel/sys.c:21
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

-> #0 (&mm->mmap_lock){++++}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3090 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain kernel/locking/lockdep.c:3825 [inline]
__lock_acquire+0x293c/0x6544 kernel/locking/lockdep.c:5049
lock_acquire+0x20c/0x644 kernel/locking/lockdep.c:5662
internal_get_user_pages_fast+0x164/0x1a70 mm/gup.c:3042
get_user_pages_fast+0x60/0x94 mm/gup.c:3150
__iov_iter_get_pages_alloc+0x2e0/0x800 lib/iov_iter.c:1460
iov_iter_get_pages2+0x74/0xbc lib/iov_iter.c:1503
dio_refill_pages fs/direct-io.c:172 [inline]
dio_get_page fs/direct-io.c:215 [inline]
do_direct_IO fs/direct-io.c:932 [inline]
__blockdev_direct_IO+0xc74/0x318c fs/direct-io.c:1266
blockdev_direct_IO include/linux/fs.h:3342 [inline]
ntfs_direct_IO+0x174/0x324 fs/ntfs3/inode.c:798
generic_file_read_iter+0x3f8/0x5a8 mm/filemap.c:2891
ntfs_file_read_iter+0x184/0x1e0 fs/ntfs3/file.c:768
call_read_iter include/linux/fs.h:2259 [inline]
new_sync_read fs/read_write.c:389 [inline]
vfs_read+0x5ac/0x7c4 fs/read_write.c:470
ksys_read+0x120/0x210 fs/read_write.c:613
__do_sys_read fs/read_write.c:623 [inline]
__se_sys_read fs/read_write.c:621 [inline]
__arm64_sys_read+0x7c/0x90 fs/read_write.c:621
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

other info that might help us debug this:

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&sb->s_type->i_mutex_key#21);
lock(&mm->mmap_lock);
lock(&sb->s_type->i_mutex_key#21);
lock(&mm->mmap_lock);

*** DEADLOCK ***

2 locks held by syz.1.645/6328:
#0: ffff0000f41e59e8 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x114/0x16c fs/file.c:1040
#1: ffff0000e38ae380 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
#1: ffff0000e38ae380 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: __blockdev_direct_IO+0x2c8/0x318c fs/direct-io.c:1162

stack backtrace:
CPU: 0 PID: 6328 Comm: syz.1.645 Not tainted 6.1.141-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack+0x30/0x40 lib/dump_stack.c:88
dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
dump_stack+0x1c/0x5c lib/dump_stack.c:113
print_circular_bug+0x148/0x1b0 kernel/locking/lockdep.c:2048
check_noncircular+0x240/0x2d4 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 kernel/locking/lockdep.c:3825 [inline]
__lock_acquire+0x293c/0x6544 kernel/locking/lockdep.c:5049
lock_acquire+0x20c/0x644 kernel/locking/lockdep.c:5662
internal_get_user_pages_fast+0x164/0x1a70 mm/gup.c:3042
get_user_pages_fast+0x60/0x94 mm/gup.c:3150
__iov_iter_get_pages_alloc+0x2e0/0x800 lib/iov_iter.c:1460
iov_iter_get_pages2+0x74/0xbc lib/iov_iter.c:1503
dio_refill_pages fs/direct-io.c:172 [inline]
dio_get_page fs/direct-io.c:215 [inline]
do_direct_IO fs/direct-io.c:932 [inline]
__blockdev_direct_IO+0xc74/0x318c fs/direct-io.c:1266
blockdev_direct_IO include/linux/fs.h:3342 [inline]
ntfs_direct_IO+0x174/0x324 fs/ntfs3/inode.c:798
generic_file_read_iter+0x3f8/0x5a8 mm/filemap.c:2891
ntfs_file_read_iter+0x184/0x1e0 fs/ntfs3/file.c:768
call_read_iter include/linux/fs.h:2259 [inline]
new_sync_read fs/read_write.c:389 [inline]
vfs_read+0x5ac/0x7c4 fs/read_write.c:470
ksys_read+0x120/0x210 fs/read_write.c:613
__do_sys_read fs/read_write.c:623 [inline]
__se_sys_read fs/read_write.c:621 [inline]
__arm64_sys_read+0x7c/0x90 fs/read_write.c:621
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585


---
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.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Sep 18, 2025, 8:01:23 PM9/18/25
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages