Kernel bug: divide error in ext4_mb_regular_allocator
Subsystem: ext4
Status: fixed

Crash report:
EXT4-fs: Ignoring removed oldalloc option
EXT4-fs (loop0): re-mounted 00000000-0000-0000-0000-000000000000 r/w. Quota mode: none.
Oops: divide error: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 0 UID: 0 PID: 5224 Comm: syz-executor196 Not tainted 6.11.0-rc2-syzkaller-00111-gee9a43b7cfe2 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
RIP: 0010:ext4_mb_regular_allocator+0x1687/0x3b80 fs/ext4/mballoc.c:2932
Code: 16 00 00 8b 1a bf 40 00 00 00 89 de e8 e2 ab 38 ff 48 83 fb 3f 0f 87 9f 19 00 00 e8 93 a7 38 ff 89 d9 49 d3 ec 4c 89 f8 31 d2 <49> f7 f4 48 89 d3 31 ff 48 89 d6 e8 59 ac 38 ff 83 bc 24 64 01 00
RSP: 0018:ffffc9000341e740 EFLAGS: 00010246
RAX: 0000000000000001 RBX: 0000000000000004 RCX: 0000000000000004
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000040
RBP: ffffc9000341e9f0 R08: ffffffff825acf3e R09: ffffffff825bea62
R10: 0000000000000005 R11: ffff8880282b1e00 R12: 0000000000000000
R13: 0000000000000003 R14: ffff8880663270e0 R15: 0000000000000001
FS:  0000555592670380(0000) GS:ffff8880b9200000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffe13f0d000 CR3: 0000000025072000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 ext4_mb_new_blocks+0x10a8/0x4e30 fs/ext4/mballoc.c:6219
 ext4_ext_map_blocks+0x1c74/0x77b0 fs/ext4/extents.c:4318
 ext4_map_blocks+0xa5e/0x1d20 fs/ext4/inode.c:652
 _ext4_get_block+0x239/0x6b0 fs/ext4/inode.c:794
 ext4_get_block_unwritten+0x2f/0x100 fs/ext4/inode.c:827
 __block_write_begin_int+0x50c/0x1a70 fs/buffer.c:2125
 ext4_try_to_write_inline_data+0x7ed/0x1360 fs/ext4/inline.c:739
 ext4_write_begin+0x2a0/0x10e0 fs/ext4/inode.c:1172
 ext4_da_write_begin+0x300/0xa70 fs/ext4/inode.c:2943
 generic_perform_write+0x399/0x840 mm/filemap.c:4019
 ext4_buffered_write_iter+0xc6/0x350 fs/ext4/file.c:299
 ext4_file_write_iter+0x1de/0x1a10
 do_iter_readv_writev+0x60a/0x890
 vfs_writev+0x37c/0xbb0 fs/read_write.c:971
 do_pwritev fs/read_write.c:1072 [inline]
 __do_sys_pwritev2 fs/read_write.c:1131 [inline]
 __se_sys_pwritev2+0x1ca/0x2d0 fs/read_write.c:1122
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fb9c91a61d9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 17 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:00007ffe13f0c6c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000148
RAX: ffffffffffffffda RBX: 00007fb9c91ef095 RCX: 00007fb9c91a61d9
RDX: 000000000000000f RSI: 00000000200002c0 RDI: 0000000000000004
RBP: 0031656c69662f2e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000a12 R11: 0000000000000246 R12: 70756f7267647362
R13: 7461785f72657375 R14: 431bde82d7b634db R15: 00007fb9c91ef03b
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:ext4_mb_regular_allocator+0x1687/0x3b80 fs/ext4/mballoc.c:2932
Code: 16 00 00 8b 1a bf 40 00 00 00 89 de e8 e2 ab 38 ff 48 83 fb 3f 0f 87 9f 19 00 00 e8 93 a7 38 ff 89 d9 49 d3 ec 4c 89 f8 31 d2 <49> f7 f4 48 89 d3 31 ff 48 89 d6 e8 59 ac 38 ff 83 bc 24 64 01 00
RSP: 0018:ffffc9000341e740 EFLAGS: 00010246
RAX: 0000000000000001 RBX: 0000000000000004 RCX: 0000000000000004
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000040
RBP: ffffc9000341e9f0 R08: ffffffff825acf3e R09: ffffffff825bea62
R10: 0000000000000005 R11: ffff8880282b1e00 R12: 0000000000000000
R13: 0000000000000003 R14: ffff8880663270e0 R15: 0000000000000001
FS:  0000555592670380(0000) GS:ffff8880b9200000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffe13f0d000 CR3: 0000000025072000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
   0:	00 00                	add    %al,(%rax)
   2:	8b 1a                	mov    (%rdx),%ebx
   4:	bf 40 00 00 00       	mov    $0x40,%edi
   9:	89 de                	mov    %ebx,%esi
   b:	e8 e2 ab 38 ff       	call   0xff38abf2
  10:	48 83 fb 3f          	cmp    $0x3f,%rbx
  14:	0f 87 9f 19 00 00    	ja     0x19b9
  1a:	e8 93 a7 38 ff       	call   0xff38a7b2
  1f:	89 d9                	mov    %ebx,%ecx
  21:	49 d3 ec             	shr    %cl,%r12
  24:	4c 89 f8             	mov    %r15,%rax
  27:	31 d2                	xor    %edx,%edx
* 29:	49 f7 f4             	div    %r12 <-- trapping instruction
  2c:	48 89 d3             	mov    %rdx,%rbx
  2f:	31 ff                	xor    %edi,%edi
  31:	48 89 d6             	mov    %rdx,%rsi
  34:	e8 59 ac 38 ff       	call   0xff38ac92
  39:	83                   	.byte 0x83
  3a:	bc 24 64 01 00       	mov    $0x16424,%esp