divide error in block2mtd_setup2

Status: upstream: reported C repro on 2026/10/03 19:16
Reported-by: syzbot+4e90b355b1ab75f4c985@syzkaller.appspotmail.com
First crash: 12d, last: 10d
▶ ▼ Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.6 divide error in block2mtd_setup2 2 syz, C 7 11d 12d 0/2 upstream: reported C repro on 2026/10/03 20:18
linux-5.15 divide error in block2mtd_setup2 origin:lts-only 2 syz, C 50 1d04h 80d 0/3 upstream: reported C repro on 2026/07/28 09:32
upstream divide error in block2mtd_setup2 prio:low mtd 2 C 8 16d 67d 26/29 upstream: reported C repro on 2026/08/10 00:34

Sample crash report:
divide error: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 4434 Comm: syz.0.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/2026
RIP: 0010:add_device drivers/mtd/devices/block2mtd.c:275 [inline]
RIP: 0010:block2mtd_setup2+0x59e/0xf30 drivers/mtd/devices/block2mtd.c:438
Code: b9 66 fc 48 8b 1b 48 83 c3 50 48 89 d8 48 c1 e8 03 42 80 3c 20 00 74 08 48 89 df e8 7c b9 66 fc 48 8b 03 48 63 4c 24 20 48 99 <48> f7 f9 48 89 d3 31 ff 48 89 d6 e8 a2 62 15 fc 48 85 db 4c 8b 6c
RSP: 0018:ffffc900033c79e0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff888148d45e28 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 000000000fc00000 RDI: 0000000001f00000
RBP: ffffc900033c7bf8 R08: ffff8880253a745f R09: 1ffff11004a74e8b
R10: dffffc0000000000 R11: ffffed1004a74e8c R12: dffffc0000000000
R13: ffffc900033c7a80 R14: 1ffff1100e88d802 R15: ffffc900033c7a80
FS:  000055557e290500(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fcb10470050 CR3: 0000000030e3e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 block2mtd_setup+0x23/0xd0 drivers/mtd/devices/block2mtd.c:455
 param_attr_store+0x20a/0x300 kernel/params.c:585
 module_attr_store+0x5b/0x80 kernel/params.c:905
 kernfs_fop_write_iter+0x3a0/0x520 fs/kernfs/file.c:352
 call_write_iter include/linux/fs.h:2271 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x482/0x9a0 fs/read_write.c:584
 ksys_write+0x14d/0x260 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fcb1059e159
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:00007fffaab71dc8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fcb10825fa0 RCX: 00007fcb1059e159
RDX: 00000000000000b3 RSI: 0000200000000250 RDI: 0000000000000003
RBP: 00007fcb1063506b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fcb10825fac R14: 00007fcb10825fa0 R15: 00007fcb10825fa0
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:add_device drivers/mtd/devices/block2mtd.c:275 [inline]
RIP: 0010:block2mtd_setup2+0x59e/0xf30 drivers/mtd/devices/block2mtd.c:438
Code: b9 66 fc 48 8b 1b 48 83 c3 50 48 89 d8 48 c1 e8 03 42 80 3c 20 00 74 08 48 89 df e8 7c b9 66 fc 48 8b 03 48 63 4c 24 20 48 99 <48> f7 f9 48 89 d3 31 ff 48 89 d6 e8 a2 62 15 fc 48 85 db 4c 8b 6c
RSP: 0018:ffffc900033c79e0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff888148d45e28 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 000000000fc00000 RDI: 0000000001f00000
RBP: ffffc900033c7bf8 R08: ffff8880253a745f R09: 1ffff11004a74e8b
R10: dffffc0000000000 R11: ffffed1004a74e8c R12: dffffc0000000000
R13: ffffc900033c7a80 R14: 1ffff1100e88d802 R15: ffffc900033c7a80
FS:  000055557e290500(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fcb10470050 CR3: 0000000030e3e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	b9 66 fc 48 8b       	mov    $0x8b48fc66,%ecx
   5:	1b 48 83             	sbb    -0x7d(%rax),%ecx
   8:	c3                   	ret
   9:	50                   	push   %rax
   a:	48 89 d8             	mov    %rbx,%rax
   d:	48 c1 e8 03          	shr    $0x3,%rax
  11:	42 80 3c 20 00       	cmpb   $0x0,(%rax,%r12,1)
  16:	74 08                	je     0x20
  18:	48 89 df             	mov    %rbx,%rdi
  1b:	e8 7c b9 66 fc       	call   0xfc66b99c
  20:	48 8b 03             	mov    (%rbx),%rax
  23:	48 63 4c 24 20       	movslq 0x20(%rsp),%rcx
  28:	48 99                	cqto
* 2a:	48 f7 f9             	idiv   %rcx <-- trapping instruction
  2d:	48 89 d3             	mov    %rdx,%rbx
  30:	31 ff                	xor    %edi,%edi
  32:	48 89 d6             	mov    %rdx,%rsi
  35:	e8 a2 62 15 fc       	call   0xfc1562dc
  3a:	48 85 db             	test   %rbx,%rbx
  3d:	4c                   	rex.WR
  3e:	8b                   	.byte 0x8b
  3f:	6c                   	insb   (%dx),%es:(%rdi)

Crashes (9):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/10/04 06:38 linux-6.1.y a500ba24937a 57bbd979 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan divide error in block2mtd_setup2
2026/10/05 20:01 linux-6.1.y a500ba24937a af63e995 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan divide error in block2mtd_setup2
2026/10/05 20:01 linux-6.1.y a500ba24937a af63e995 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan divide error in block2mtd_setup2
2026/10/04 20:13 linux-6.1.y a500ba24937a 57bbd979 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan divide error in block2mtd_setup2
2026/10/04 20:13 linux-6.1.y a500ba24937a 57bbd979 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan divide error in block2mtd_setup2
2026/10/04 13:59 linux-6.1.y a500ba24937a 57bbd979 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan divide error in block2mtd_setup2
2026/10/04 13:58 linux-6.1.y a500ba24937a 57bbd979 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan divide error in block2mtd_setup2
2026/10/03 19:15 linux-6.1.y a500ba24937a 57bbd979 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan divide error in block2mtd_setup2
2026/10/03 19:15 linux-6.1.y a500ba24937a 57bbd979 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan divide error in block2mtd_setup2
* Struck through repros no longer work on HEAD.