syzbot


BUG: unable to handle kernel paging request in __bch2_writepage

Status: moderation: reported on 2025/06/05 21:57
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+eec2cf70b6cfb731479f@syzkaller.appspotmail.com
First crash: 55d, last: 46d

Sample crash report:
BUG: unable to handle page fault for address: fffffffffffffc98
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page
PGD df3d067 P4D df3d067 PUD df3f067 PMD 0 
Oops: Oops: 0002 [#1] SMP KASAN PTI
CPU: 0 UID: 0 PID: 7132 Comm: syz.6.155 Not tainted 6.16.0-rc1-syzkaller-00004-gaef17cb3d3c4 #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
RIP: 0010:bch2_writepage_io_alloc fs/bcachefs/fs-io-buffered.c:508 [inline]
RIP: 0010:__bch2_writepage+0x15b7/0x2790 fs/bcachefs/fs-io-buffered.c:636
Code: ff e8 9d a4 e8 fd 49 81 c6 98 fc ff ff 4d 89 37 4c 89 f0 48 c1 e8 03 80 3c 18 00 74 08 4c 89 f7 e8 7e a4 e8 fd 48 8b 44 24 68 <49> 89 06 4d 8b 37 48 8b 94 24 a0 00 00 00 48 89 d0 48 c1 e8 03 0f
RSP: 0018:ffffc9000b147290 EFLAGS: 00010246

RAX: ffff88805b501e60 RBX: dffffc0000000000 RCX: ffff888026e6da00
RDX: 0000000000000000 RSI: 0000000000000100 RDI: 0000000000000000
RBP: 0000000000000020 R08: ffff8880665c8948 R09: 1ffffd4000278540
R10: dffffc0000000000 R11: fffff94000278541 R12: 1ffff110063d8840
R13: 0000000000000020 R14: fffffffffffffc98 R15: ffff888031ec4200
FS:  00007f45ead8a6c0(0000) GS:ffff888125c86000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: fffffffffffffc98 CR3: 000000003136c000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 write_cache_pages+0x64/0x100 mm/page-writeback.c:2614
 bch2_writepages+0xf9/0x2d0 fs/bcachefs/fs-io-buffered.c:666
 do_writepages+0x32b/0x550 mm/page-writeback.c:2636
 filemap_fdatawrite_wbc mm/filemap.c:386 [inline]
 __filemap_fdatawrite_range mm/filemap.c:419 [inline]
 file_write_and_wait_range+0x22c/0x330 mm/filemap.c:794
 bch2_fsync+0x127/0x330 fs/bcachefs/fs-io.c:245
 generic_write_sync include/linux/fs.h:3027 [inline]
 bch2_write_iter+0x2822/0x2b90 fs/bcachefs/fs-io-buffered.c:1089
 do_iter_readv_writev+0x56b/0x7f0 fs/read_write.c:-1
 vfs_writev+0x31a/0x960 fs/read_write.c:1057
 do_pwritev fs/read_write.c:1153 [inline]
 __do_sys_pwritev2 fs/read_write.c:1211 [inline]
 __se_sys_pwritev2+0x179/0x290 fs/read_write.c:1202
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f45e9f8e929
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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f45ead8a038 EFLAGS: 00000246
 ORIG_RAX: 0000000000000148
RAX: ffffffffffffffda RBX: 00007f45ea1b6080 RCX: 00007f45e9f8e929
RDX: 0000000000000001 RSI: 00002000000001c0 RDI: 000000000000000c
RBP: 00007f45ea010b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000e7b R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f45ea1b6080 R15: 00007ffe25ee2db8
 </TASK>
Modules linked in:
CR2: fffffffffffffc98
---[ end trace 0000000000000000 ]---
RIP: 0010:bch2_writepage_io_alloc fs/bcachefs/fs-io-buffered.c:508 [inline]
RIP: 0010:__bch2_writepage+0x15b7/0x2790 fs/bcachefs/fs-io-buffered.c:636
Code: ff e8 9d a4 e8 fd 49 81 c6 98 fc ff ff 4d 89 37 4c 89 f0 48 c1 e8 03 80 3c 18 00 74 08 4c 89 f7 e8 7e a4 e8 fd 48 8b 44 24 68 <49> 89 06 4d 8b 37 48 8b 94 24 a0 00 00 00 48 89 d0 48 c1 e8 03 0f
RSP: 0018:ffffc9000b147290 EFLAGS: 00010246
RAX: ffff88805b501e60 RBX: dffffc0000000000 RCX: ffff888026e6da00
RDX: 0000000000000000 RSI: 0000000000000100 RDI: 0000000000000000
RBP: 0000000000000020 R08: ffff8880665c8948 R09: 1ffffd4000278540
R10: dffffc0000000000 R11: fffff94000278541 R12: 1ffff110063d8840
R13: 0000000000000020 R14: fffffffffffffc98 R15: ffff888031ec4200
FS:  00007f45ead8a6c0(0000) GS:ffff888125c86000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: fffffffffffffc98 CR3: 000000003136c000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
   0:	e8 9d a4 e8 fd       	call   0xfde8a4a2
   5:	49 81 c6 98 fc ff ff 	add    $0xfffffffffffffc98,%r14
   c:	4d 89 37             	mov    %r14,(%r15)
   f:	4c 89 f0             	mov    %r14,%rax
  12:	48 c1 e8 03          	shr    $0x3,%rax
  16:	80 3c 18 00          	cmpb   $0x0,(%rax,%rbx,1)
  1a:	74 08                	je     0x24
  1c:	4c 89 f7             	mov    %r14,%rdi
  1f:	e8 7e a4 e8 fd       	call   0xfde8a4a2
  24:	48 8b 44 24 68       	mov    0x68(%rsp),%rax
* 29:	49 89 06             	mov    %rax,(%r14) <-- trapping instruction
  2c:	4d 8b 37             	mov    (%r15),%r14
  2f:	48 8b 94 24 a0 00 00 	mov    0xa0(%rsp),%rdx
  36:	00
  37:	48 89 d0             	mov    %rdx,%rax
  3a:	48 c1 e8 03          	shr    $0x3,%rax
  3e:	0f                   	.byte 0xf

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/06/11 02:16 upstream aef17cb3d3c4 5d7e17ca .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: unable to handle kernel paging request in __bch2_writepage
2025/06/07 13:10 upstream c0c9379f235d 4826c28e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: unable to handle kernel paging request in __bch2_writepage
2025/06/04 01:34 upstream 546b1c9e93c2 a30356b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: unable to handle kernel paging request in __bch2_writepage
2025/06/01 21:53 upstream 7d4e49a77d99 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: unable to handle kernel paging request in __bch2_writepage
* Struck through repros no longer work on HEAD.