syzbot


kernel BUG in ext4_writepages

Status: fixed on 2022/11/16 18:44
Reported-by: syzbot+bd13648a53ed6933ca49@syzkaller.appspotmail.com
Fix commit: fb98cb61efff ext4: avoid crash when inline data creation follows DIO write
First crash: 662d, last: 500d
Cause bisection: failed (error log, bisect log)
  
Discussions (11)
Title Replies (including bot) Last reply
[PATCH 5.15 000/530] 5.15.75-rc1 review 542 (542) 2023/01/10 15:19
Re: kernel BUG in ext4_writepages 1 (1) 2022/11/07 14:08
[PATCH 5.4 000/255] 5.4.220-rc1 review 276 (276) 2022/11/01 17:29
[PATCH 4.19 000/229] 4.19.262-rc1 review 242 (242) 2022/11/01 13:44
[PATCH 4.9 000/159] 4.9.331-rc1 review 165 (165) 2022/10/25 17:41
[PATCH 4.14 000/210] 4.14.296-rc1 review 213 (213) 2022/10/25 17:38
[PATCH 5.10 000/390] 5.10.150-rc1 review 407 (407) 2022/10/25 15:12
[PATCH 5.19 000/717] 5.19.17-rc1 review 732 (732) 2022/10/24 19:01
[PATCH 6.0 000/862] 6.0.3-rc1 review 899 (899) 2022/10/21 09:08
[PATCH] ext4: Avoid crash when inline data creation follows DIO write 4 (4) 2022/09/27 21:53
[PATCH] ext4: try to flush inline data before calling BUG in writepages 5 (5) 2022/07/27 17:51
Similar bugs (14)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 kernel BUG at fs/ext4/inode.c:LINE! ext4 C error 145 361d 1235d 0/1 upstream: reported C repro on 2020/10/14 01:19
android-54 kernel BUG at fs/ext4/inode.c:LINE! ext4 C 154 2d16h 1508d 0/2 upstream: reported C repro on 2020/01/14 12:13
linux-5.15 kernel BUG in ext4_writepages origin:upstream C error 23 3d23h 355d 0/3 upstream: reported C repro on 2023/03/13 06:22
linux-4.14 kernel BUG at fs/ext4/inode.c:LINE! ext4 C 11 369d 1163d 0/1 upstream: reported C repro on 2020/12/25 03:51
linux-6.1 kernel BUG in ext4_writepages origin:upstream C 35 4d01h 355d 0/3 upstream: reported C repro on 2023/03/12 17:26
android-5-15 kernel BUG in ext4_writepages ext4 origin:upstream C error 73 1d04h 500d 0/2 upstream: reported C repro on 2022/10/18 14:12
android-6-1 kernel BUG in ext4_writepages origin:upstream C error 25 6d07h 271d 0/2 upstream: reported C repro on 2023/06/05 07:33
upstream kernel BUG in mpage_prepare_extent_to_map ext4 C done error 145 445d 1006d 0/26 upstream: reported C repro on 2021/05/31 07:15
android-5-10 kernel BUG in ext4_writepages (2) ext4 C error inconclusive 103 2d20h 461d 0/2 upstream: reported C repro on 2022/11/27 00:51
upstream kernel BUG at fs/ext4/inode.c:LINE! ext4 C done 9 1158d 1283d 19/26 fixed on 2021/03/10 01:48
android-49 kernel BUG at fs/ext4/inode.c:LINE! C 280 1857d 1787d 0/3 public: reported C repro on 2019/04/11 08:44
android-414 kernel BUG at fs/ext4/inode.c:LINE! 1 1932d 1784d 0/1 auto-closed as invalid on 2019/05/15 13:37
android-5-10 kernel BUG in mpage_prepare_extent_to_map C error 254 682d 850d 2/2 fixed on 2022/04/21 04:24
android-44 kernel BUG at fs/ext4/inode.c:LINE! C 110 1874d 1787d 0/2 public: reported C repro on 2019/04/11 08:44
Last patch testing requests (8)
Created Duration User Patch Repo Result
2022/07/27 19:07 7m tadeusz.struk@linaro.org patch https://android.googlesource.com/kernel/common android12-5.4 error OK
2022/07/27 16:11 16m tadeusz.struk@linaro.org patch android12-5.10-lts OK log
2022/07/27 16:10 14m tadeusz.struk@linaro.org patch git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master OK log
2022/07/26 01:22 18m tadeusz.struk@linaro.org patch git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master OK log
2022/07/22 23:08 10m tadeusz.struk@linaro.org git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master report log
2022/05/19 23:01 13m tadeusz.struk@linaro.org patch git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master OK
2022/05/19 22:52 14m tadeusz.struk@linaro.org patch android12-5.10-lts OK
2022/05/19 22:51 6m tadeusz.struk@linaro.org patch git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master error OK
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2022/07/08 19:48 15m bisect fix android12-5.10-lts job log (0) log
2022/06/08 19:27 21m bisect fix android12-5.10-lts job log (0) log

Sample crash report:
------------[ cut here ]------------
kernel BUG at fs/ext4/inode.c:2760!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 371 Comm: syz-executor189 Not tainted 5.10.147-syzkaller-01341-gbc7618b4936f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022
RIP: 0010:ext4_writepages+0x36f6/0x3710 fs/ext4/inode.c:2759
Code: c6 31 ff e8 fc fe 8f ff 84 db 75 2c e8 e3 fb 8f ff 48 bb 00 00 00 00 00 fc ff df 4c 8b 64 24 40 e9 28 f7 ff ff e8 ca fb 8f ff <0f> 0b e8 c3 fb 8f ff e8 fd 92 23 ff eb a0 e8 b7 fb 8f ff e8 f1 92
RSP: 0018:ffffc9000029f300 EFLAGS: 00010293
RAX: ffffffff81dcef46 RBX: 0000008000000000 RCX: ffff8881067a0000
RDX: 0000000000000000 RSI: 0000008000000000 RDI: 0000000000000000
RBP: ffffc9000029f6f0 R08: ffffffff81dcbf2a R09: ffffed1021ce5e12
R10: ffffed1021ce5e12 R11: 1ffff11021ce5e11 R12: ffff8881057ef000
R13: ffffc9000029f5c0 R14: 000000c410000000 R15: ffffc9000029f860
FS:  000055555621a300(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055c3207d71c8 CR3: 00000001049b8000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 do_writepages+0x13a/0x280 mm/page-writeback.c:2358
 __filemap_fdatawrite_range+0x354/0x420 mm/filemap.c:427
 file_write_and_wait_range+0x89/0x120 mm/filemap.c:766
 ext4_sync_file+0x19e/0x9d0 fs/ext4/fsync.c:151
 vfs_fsync_range+0x17b/0x190 fs/sync.c:202
 generic_write_sync include/linux/fs.h:2796 [inline]
 ext4_buffered_write_iter+0x565/0x610 fs/ext4/file.c:280
 ext4_file_write_iter+0x192/0x1cd0 fs/ext4/file.c:683
 call_write_iter include/linux/fs.h:1947 [inline]
 new_sync_write fs/read_write.c:518 [inline]
 vfs_write+0xc4a/0xf80 fs/read_write.c:605
 ksys_write+0x198/0x2c0 fs/read_write.c:658
 __do_sys_write fs/read_write.c:670 [inline]
 __se_sys_write fs/read_write.c:667 [inline]
 __x64_sys_write+0x7b/0x90 fs/read_write.c:667
 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x61/0xc6
RIP: 0033:0x7f21224a8ef9
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:00007ffe71cb9ee8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007f21224a8ef9
RDX: 0000000000000088 RSI: 0000000020000440 RDI: 0000000000000006
RBP: 00007f21224686f0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f2122468780
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace ea75070fa1a2c9e6 ]---
RIP: 0010:ext4_writepages+0x36f6/0x3710 fs/ext4/inode.c:2759
Code: c6 31 ff e8 fc fe 8f ff 84 db 75 2c e8 e3 fb 8f ff 48 bb 00 00 00 00 00 fc ff df 4c 8b 64 24 40 e9 28 f7 ff ff e8 ca fb 8f ff <0f> 0b e8 c3 fb 8f ff e8 fd 92 23 ff eb a0 e8 b7 fb 8f ff e8 f1 92
RSP: 0018:ffffc9000029f300 EFLAGS: 00010293
RAX: ffffffff81dcef46 RBX: 0000008000000000 RCX: ffff8881067a0000
RDX: 0000000000000000 RSI: 0000008000000000 RDI: 0000000000000000
RBP: ffffc9000029f6f0 R08: ffffffff81dcbf2a R09: ffffed1021ce5e12
R10: ffffed1021ce5e12 R11: 1ffff11021ce5e11 R12: ffff8881057ef000
R13: ffffc9000029f5c0 R14: 000000c410000000 R15: ffffc9000029f860
FS:  000055555621a300(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055c3207d71c8 CR3: 00000001049b8000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/10/18 14:27 android12-5.10-lts bc7618b4936f b31320fc .config strace log report syz C [mounted in repro] ci2-android-5-10 kernel BUG in ext4_writepages
2022/08/17 12:20 android12-5.10-lts ee965fe12def 4e72d229 .config strace log report syz C ci2-android-5-10 kernel BUG in ext4_writepages
2022/05/09 19:21 android12-5.10-lts de64d941a71a 8b277b8e .config strace log report syz C ci2-android-5-10 kernel BUG in ext4_writepages
2022/08/15 11:12 android12-5.10-lts 30abcdabf21e 8dfcaa3d .config console log report info ci2-android-5-10 kernel BUG in ext4_writepages
2022/08/15 04:28 android12-5.10-lts 30abcdabf21e 8dfcaa3d .config console log report info ci2-android-5-10 kernel BUG in ext4_writepages
* Struck through repros no longer work on HEAD.