divide error in block2mtd_setup2

Status: upstream: reported C repro on 2026/07/28 09:32
Reported-by: syzbot+7e13341c5d62c0bd821b@syzkaller.appspotmail.com
First crash: 13d, last: 4d00h
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream divide error in block2mtd_setup2 mtd prio:low 2 1 6d15h 1d04h 0/29 upstream: reported on 2026/08/10 00:34

Sample crash report:
divide error: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 4337 Comm: syz.0.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:add_device drivers/mtd/devices/block2mtd.c:272 [inline]
RIP: 0010:block2mtd_setup2+0x5b0/0xd90 drivers/mtd/devices/block2mtd.c:425
Code: 48 c1 e8 03 49 bd 00 00 00 00 00 fc ff df 42 80 3c 28 00 4c 8b 7c 24 18 74 08 4c 89 f7 e8 38 97 91 fc 49 8b 06 49 63 cf 48 99 <48> f7 f9 49 89 d6 31 ff 48 89 d6 e8 40 78 4c fc 4d 85 f6 0f 85 98
RSP: 0018:ffffc90002fcf9e0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 1ffff1100f825002 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000700000 RDI: 0000000001f00000
RBP: ffffc90002fcfbd0 R08: ffff8880205d44af R09: 1ffff110040ba895
R10: dffffc0000000000 R11: ffffed10040ba896 R12: ffffc90002fcfa60
R13: dffffc0000000000 R14: ffff888017095920 R15: 0000000000000000
FS:  000055558107f500(0000) GS:ffff8880b9000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fefb6821d60 CR3: 000000001ffb6000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 block2mtd_setup+0x1f/0x40 drivers/mtd/devices/block2mtd.c:442
 param_attr_store+0x20a/0x300 kernel/params.c:585
 module_attr_store+0x5b/0x80 kernel/params.c:905
 kernfs_fop_write_iter+0x3a8/0x500 fs/kernfs/file.c:296
 call_write_iter include/linux/fs.h:2173 [inline]
 new_sync_write fs/read_write.c:507 [inline]
 vfs_write+0x748/0xd70 fs/read_write.c:594
 ksys_write+0x153/0x260 fs/read_write.c:647
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fefb6950019
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe7f6d86d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fefb6bd7fa0 RCX: 00007fefb6950019
RDX: 000000000000000b RSI: 00002000000001c0 RDI: 0000000000000003
RBP: 00007fefb69e700c R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fefb6bd7fac R14: 00007fefb6bd7fa0 R15: 00007fefb6bd7fa0
 </TASK>
Modules linked in:
---[ end trace a0b9c4d8c7d8cf12 ]---
RIP: 0010:add_device drivers/mtd/devices/block2mtd.c:272 [inline]
RIP: 0010:block2mtd_setup2+0x5b0/0xd90 drivers/mtd/devices/block2mtd.c:425
Code: 48 c1 e8 03 49 bd 00 00 00 00 00 fc ff df 42 80 3c 28 00 4c 8b 7c 24 18 74 08 4c 89 f7 e8 38 97 91 fc 49 8b 06 49 63 cf 48 99 <48> f7 f9 49 89 d6 31 ff 48 89 d6 e8 40 78 4c fc 4d 85 f6 0f 85 98
RSP: 0018:ffffc90002fcf9e0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 1ffff1100f825002 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000700000 RDI: 0000000001f00000
RBP: ffffc90002fcfbd0 R08: ffff8880205d44af R09: 1ffff110040ba895
R10: dffffc0000000000 R11: ffffed10040ba896 R12: ffffc90002fcfa60
R13: dffffc0000000000 R14: ffff888017095920 R15: 0000000000000000
FS:  000055558107f500(0000) GS:ffff8880b9100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b30924008 CR3: 000000001ffb6000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	48 c1 e8 03          	shr    $0x3,%rax
   4:	49 bd 00 00 00 00 00 	movabs $0xdffffc0000000000,%r13
   b:	fc ff df
   e:	42 80 3c 28 00       	cmpb   $0x0,(%rax,%r13,1)
  13:	4c 8b 7c 24 18       	mov    0x18(%rsp),%r15
  18:	74 08                	je     0x22
  1a:	4c 89 f7             	mov    %r14,%rdi
  1d:	e8 38 97 91 fc       	call   0xfc91975a
  22:	49 8b 06             	mov    (%r14),%rax
  25:	49 63 cf             	movslq %r15d,%rcx
  28:	48 99                	cqto
* 2a:	48 f7 f9             	idiv   %rcx <-- trapping instruction
  2d:	49 89 d6             	mov    %rdx,%r14
  30:	31 ff                	xor    %edi,%edi
  32:	48 89 d6             	mov    %rdx,%rsi
  35:	e8 40 78 4c fc       	call   0xfc4c787a
  3a:	4d 85 f6             	test   %r14,%r14
  3d:	0f                   	.byte 0xf
  3e:	85                   	.byte 0x85
  3f:	98                   	cwtl

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/07/31 07:53 linux-5.15.y 6e2fd6534337 aaffb173 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan divide error in block2mtd_setup2
2026/08/07 04:37 linux-5.15.y 9c7634c60784 c38879ea .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan divide error in block2mtd_setup2
2026/08/07 04:37 linux-5.15.y 9c7634c60784 c38879ea .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan divide error in block2mtd_setup2
2026/08/07 03:33 linux-5.15.y 9c7634c60784 c38879ea .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan divide error in block2mtd_setup2
2026/08/07 01:17 linux-5.15.y 9c7634c60784 c38879ea .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan divide error in block2mtd_setup2
2026/08/07 01:17 linux-5.15.y 9c7634c60784 c38879ea .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan divide error in block2mtd_setup2
2026/08/03 08:44 linux-5.15.y 6e2fd6534337 e611ffe1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan divide error in block2mtd_setup2
2026/08/03 08:42 linux-5.15.y 6e2fd6534337 e611ffe1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan divide error in block2mtd_setup2
2026/07/28 09:32 linux-5.15.y 674f684f7c61 45ae1df4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan divide error in block2mtd_setup2
2026/07/28 09:32 linux-5.15.y 674f684f7c61 45ae1df4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan divide error in block2mtd_setup2
* Struck through repros no longer work on HEAD.