syzbot


WARNING: nested lock was not taken in ntfs_file_write_iter

Status: auto-obsoleted due to no activity on 2024/02/15 12:06
Subsystems: ntfs3
[Documentation on labels]
Reported-by: syzbot+12dd1b7c210b98623391@syzkaller.appspotmail.com
First crash: 218d, last: 110d
Cause bisection: introduced by (bisect log) :
commit ad26a9c84510af7252e582e811de970433a9758f
Author: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Date: Fri Oct 7 17:08:06 2022 +0000

  fs/ntfs3: Fixing wrong logic in attr_set_size and ntfs_fallocate

Crash: KASAN: out-of-bounds Write in end_buffer_read_sync (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [ntfs3?] WARNING: nested lock was not taken in ntfs_file_write_iter 0 (1) 2023/07/26 22:56
Last patch testing requests (2)
Created Duration User Patch Repo Result
2023/11/21 13:05 25m retest repro linux-next OK log
2023/08/31 09:37 20m retest repro linux-next report log

Sample crash report:
==================================
WARNING: Nested lock was not taken
6.5.0-rc2-next-20230721-syzkaller #0 Not tainted
----------------------------------
syz-executor992/5289 is trying to lock:
ffff888077f9f240 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: inode_trylock include/linux/fs.h:791 [inline]
ffff888077f9f240 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: ntfs_file_write_iter+0x236/0x1c10 fs/ntfs3/file.c:1060

but this task is not holding:
general protection fault, probably for non-canonical address 0xdffffc0000000003: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f]
CPU: 0 PID: 5289 Comm: syz-executor992 Not tainted 6.5.0-rc2-next-20230721-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2023
RIP: 0010:print_lock_nested_lock_not_held kernel/locking/lockdep.c:4974 [inline]
RIP: 0010:__lock_acquire+0x12bb/0x5de0 kernel/locking/lockdep.c:5135
Code: fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 40 4a 00 00 48 b8 00 00 00 00 00 fc ff df 49 8b 5d 18 48 8d 7b 18 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 13 4a 00 00 48 8b 73 18 48 c7 c7 20 b1 6c 8a e8
RSP: 0018:ffffc90004017368 EFLAGS: 00010006
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000003 RSI: ffffffff816acb50 RDI: 0000000000000018
RBP: ffff88801fc20ac8 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000080000000 R11: 0000000000000001 R12: ffff88801fc20000
R13: ffff88801fc20af0 R14: 0000000000000001 R15: ffffed1003f84158
FS:  000055555625d380(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005555562666f8 CR3: 0000000029b9f000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 lock_acquire kernel/locking/lockdep.c:5761 [inline]
 lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5726
 down_write_trylock kernel/locking/rwsem.c:1604 [inline]
 down_write_trylock+0x1ae/0x3d0 kernel/locking/rwsem.c:1599
 inode_trylock include/linux/fs.h:791 [inline]
 ntfs_file_write_iter+0x236/0x1c10 fs/ntfs3/file.c:1060
 call_write_iter include/linux/fs.h:1917 [inline]
 do_iter_readv_writev+0x21e/0x3c0 fs/read_write.c:735
 do_iter_write+0x17f/0x830 fs/read_write.c:860
 vfs_iter_write+0x7a/0xb0 fs/read_write.c:901
 iter_file_splice_write+0x698/0xbf0 fs/splice.c:738
 do_splice_from fs/splice.c:933 [inline]
 direct_splice_actor+0x118/0x180 fs/splice.c:1142
 splice_direct_to_actor+0x347/0xa30 fs/splice.c:1088
 do_splice_direct+0x1af/0x280 fs/splice.c:1194
 do_sendfile+0xb88/0x1390 fs/read_write.c:1254
 __do_sys_sendfile64 fs/read_write.c:1322 [inline]
 __se_sys_sendfile64 fs/read_write.c:1308 [inline]
 __x64_sys_sendfile64+0x1d6/0x220 fs/read_write.c:1308
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f906989afd9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 01 1b 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:00007fff4bf5f198 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007f906989afd9
RDX: 0000000000000000 RSI: 0000000000000007 RDI: 0000000000000006
RBP: 0000000000000000 R08: 00007fff4bf5f1d0 R09: 00007fff4bf5f1d0
R10: 000000007fffffff R11: 0000000000000246 R12: 00007fff4bf5f1bc
R13: 00000000000000cd R14: 431bde82d7b634db R15: 00007fff4bf5f1f0
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:print_lock_nested_lock_not_held kernel/locking/lockdep.c:4974 [inline]
RIP: 0010:__lock_acquire+0x12bb/0x5de0 kernel/locking/lockdep.c:5135
Code: fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 40 4a 00 00 48 b8 00 00 00 00 00 fc ff df 49 8b 5d 18 48 8d 7b 18 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 13 4a 00 00 48 8b 73 18 48 c7 c7 20 b1 6c 8a e8
RSP: 0018:ffffc90004017368 EFLAGS: 00010006
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000003 RSI: ffffffff816acb50 RDI: 0000000000000018
RBP: ffff88801fc20ac8 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000080000000 R11: 0000000000000001 R12: ffff88801fc20000
R13: ffff88801fc20af0 R14: 0000000000000001 R15: ffffed1003f84158
FS:  000055555625d380(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005555562666f8 CR3: 0000000029b9f000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 3 bytes skipped:
   0:	48 c1 ea 03          	shr    $0x3,%rdx
   4:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1)
   8:	0f 85 40 4a 00 00    	jne    0x4a4e
   e:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  15:	fc ff df
  18:	49 8b 5d 18          	mov    0x18(%r13),%rbx
  1c:	48 8d 7b 18          	lea    0x18(%rbx),%rdi
  20:	48 89 fa             	mov    %rdi,%rdx
  23:	48 c1 ea 03          	shr    $0x3,%rdx
* 27:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1) <-- trapping instruction
  2b:	0f 85 13 4a 00 00    	jne    0x4a44
  31:	48 8b 73 18          	mov    0x18(%rbx),%rsi
  35:	48 c7 c7 20 b1 6c 8a 	mov    $0xffffffff8a6cb120,%rdi
  3c:	e8                   	.byte 0xe8

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/07/22 22:50 linux-next ae867bc97b71 27cbe77f .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-linux-next-kasan-gce-root WARNING: nested lock was not taken in ntfs_file_write_iter
2023/11/07 12:05 upstream be3ca57cfb77 83211397 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: nested lock was not taken in ntfs_file_write_iter
2023/07/27 21:29 upstream 57012c57536f 92476829 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: nested lock was not taken in ntfs_file_write_iter
* Struck through repros no longer work on HEAD.