syzbot


WARNING in cow_file_range_inline

Status: upstream: reported C repro on 2022/10/25 22:18
Reported-by: syzbot+858534c396b0cdd291d2@syzkaller.appspotmail.com
First crash: 32d, last: 28d

Cause bisection: introduced by (bisect log) :
commit caae78e032343df525b8d05c58b462827f10b2a3
Author: Omar Sandoval <osandov@fb.com>
Date: Tue Mar 15 01:12:35 2022 +0000

  btrfs: move common inode creation code into btrfs_create_new_inode()

Crash: WARNING in cow_file_range_inline (log)
Repro: C syz .config

Sample crash report:
BTRFS info (device loop0): enabling ssd optimizations
------------[ cut here ]------------
BTRFS: Transaction aborted (error -12)
WARNING: CPU: 0 PID: 3604 at fs/btrfs/inode.c:454 cow_file_range_inline+0x87c/0x9a0 fs/btrfs/inode.c:454
Modules linked in:
CPU: 0 PID: 3604 Comm: syz-executor345 Not tainted 6.1.0-rc2-syzkaller-00061-g337a0a0b63f1 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022
RIP: 0010:cow_file_range_inline+0x87c/0x9a0 fs/btrfs/inode.c:454
Code: 49 8b 3e 48 c7 c6 40 f8 da 8a 89 da 31 c0 e8 dd 97 a6 06 eb 1a e8 34 9c fc fd 48 c7 c7 40 f7 da 8a 89 de 31 c0 e8 84 3a c4 fd <0f> 0b 41 b7 01 4c 8b 64 24 08 4c 8b 2c 24 45 0f b6 c7 4c 8b 7c 24
RSP: 0018:ffffc90003d8ed00 EFLAGS: 00010246
RAX: c935d7c7edbb6300 RBX: 00000000fffffff4 RCX: ffff888077ebba80
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffffc90003d8ee30 R08: ffffffff816b8d3d R09: ffffed1017344f13
R10: ffffed1017344f13 R11: 1ffff11017344f12 R12: 1ffff1100e669a5e
R13: ffff88801d524001 R14: ffff88807334d2f0 R15: 00000000fffffff4
FS:  0000555555892300(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020003180 CR3: 000000001d484000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 cow_file_range+0x391/0xfa0 fs/btrfs/inode.c:1219
 btrfs_run_delalloc_range+0xed4/0x11a0 fs/btrfs/inode.c:2229
 writepage_delalloc+0x25e/0x540 fs/btrfs/extent_io.c:1968
 __extent_writepage+0x5d6/0x14d0 fs/btrfs/extent_io.c:2272
 extent_write_cache_pages+0x9e7/0x12d0 fs/btrfs/extent_io.c:3186
 extent_writepages+0x228/0x550 fs/btrfs/extent_io.c:3308
 do_writepages+0x3c3/0x680 mm/page-writeback.c:2469
 filemap_fdatawrite_wbc+0x11e/0x170 mm/filemap.c:388
 __filemap_fdatawrite_range mm/filemap.c:421 [inline]
 filemap_fdatawrite_range+0x175/0x200 mm/filemap.c:439
 btrfs_fdatawrite_range fs/btrfs/file.c:4140 [inline]
 start_ordered_ops fs/btrfs/file.c:2026 [inline]
 btrfs_sync_file+0x39e/0x1140 fs/btrfs/file.c:2102
 generic_write_sync include/linux/fs.h:2883 [inline]
 btrfs_do_write_iter+0xa6f/0x1370 fs/btrfs/file.c:1975
 call_write_iter include/linux/fs.h:2191 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x7dc/0xc50 fs/read_write.c:584
 ksys_write+0x177/0x2a0 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f4612b05f79
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff76769238 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f4612b05f79
RDX: 0000000000000001 RSI: 0000000020003180 RDI: 0000000000000006
RBP: 00007fff76769260 R08: 0000000000000002 R09: 00007fff76769270
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000007
R13: 00007f4612b4e6b8 R14: 00007fff76769280 R15: 0000000000000000
 </TASK>

Crashes (4):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-fs 2022/10/25 13:29 upstream 337a0a0b63f1 45645420 .config log report syz C WARNING in cow_file_range_inline
ci-upstream-kasan-gce-smack-root 2022/10/29 13:27 upstream b229b6ca5abb 899d812a .config log report info WARNING in cow_file_range_inline
ci2-upstream-fs 2022/10/29 11:43 upstream b229b6ca5abb 899d812a .config log report info WARNING in cow_file_range_inline
ci2-upstream-fs 2022/10/25 12:36 upstream 337a0a0b63f1 45645420 .config log report info WARNING in cow_file_range_inline
* Struck through repros no longer work on HEAD.