divide error in block2mtd_setup2

Status: upstream: reported C repro on 2026/08/10 00:34
Subsystems: mtd
Labels: prio:low
[Documentation on labels]
Reported-by: syzbot+b320a4d5f65a61dbbf89@syzkaller.appspotmail.com
First crash: 7d04h, last: 47m
✨ AI Jobs (3)
ID Workflow Result Correct Bug Created Started Finished Revision
dbe2755e repro-c Reproduced: ✅ divide error in block2mtd_setup2 2026/08/11 14:53 2026/08/11 15:20 2026/08/11 16:22 f8d35649
6092b509 repro-c Reproduced: ✅ divide error in block2mtd_setup2 2026/08/10 07:48 2026/08/10 07:48 2026/08/10 07:56 5d63f80b
7c0d9f2e assessment-security DenialOfService: ✅ Exploitable: ❌ FilesystemTrigger: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ divide error in block2mtd_setup2 2026/08/09 16:38 2026/08/09 16:38 2026/08/09 17:07 5d63f80b
Discussions (2)
Title Replies (including bot) Last reply
[syzbot] [mtd?] divide error in block2mtd_setup2 6 (8) 2026/08/11 17:15
[PATCH] mtd: block2mtd: Fix divide error when erase_size is zero 1 (1) 2026/08/10 09:12
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 divide error in block2mtd_setup2 2 syz, C 10 4d13h 14d 0/3 upstream: reported C repro on 2026/07/28 09:32
Last patch testing requests (4)
Created Duration User Patch Repo Result
2026/08/11 16:54 20m nogikh@google.com upstream report log
2026/08/10 17:41 20m nogikh@google.com upstream error
2026/08/10 12:41 23m nogikh@google.com upstream error
2026/08/10 08:58 27m nogikh@google.com upstream error

Sample crash report:
Oops: divide error: 0000 [#1] SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 6029 Comm: syz-executor518 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:add_device drivers/mtd/devices/block2mtd.c:296 [inline]
RIP: 0010:block2mtd_setup2.isra.0+0x3c8/0xc70 drivers/mtd/devices/block2mtd.c:459
Code: 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 2b 08 00 00 48 8b 6d 08 31 ff 48 89 e8 48 c1 e0 09 48 99 <49> f7 ff 48 89 d6 48 89 54 24 10 e8 98 d5 4d fb 48 8b 54 24 10 48
RSP: 0018:ffffc90004ccf9f0 EFLAGS: 00010206
RAX: 0000000000100000 RBX: 1ffff92000999f41 RCX: ffffffff86bc9838
RDX: 0000000000000000 RSI: ffffffff86bc984a RDI: 0000000000000000
RBP: 0000000000000800 R08: 0000000000000005 R09: 000000000000001f
R10: 0000000000000007 R11: 0000000000000000 R12: ffffc90004ccfaa8
R13: 0000000000000000 R14: ffff8880254fe000 R15: 0000000000000000
FS:  000055558148e400(0000) GS:ffff8880d5dec000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055a8208cda78 CR3: 000000003ad58000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 block2mtd_setup+0xbd/0xd0 drivers/mtd/devices/block2mtd.c:476
 param_attr_store+0x199/0x300 kernel/params.c:589
 module_attr_store+0x58/0x80 kernel/params.c:904
 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145
 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x6ac/0x1050 fs/read_write.c:687
 ksys_write+0x12a/0x250 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f0b39a14737
Code: 48 89 fa 4c 89 df e8 98 1d 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff
RSP: 002b:00007ffdcc22a9a0 EFLAGS: 00000202 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 000055558148e400 RCX: 00007f0b39a14737
RDX: 000000000000000c RSI: 00007ffdcc22aa50 RDI: 0000000000000004
RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 00007ffdcc22aa50
R13: 00007ffdcc22aa10 R14: 00007ffdcc22a9f0 R15: 0000000000000002
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:add_device drivers/mtd/devices/block2mtd.c:296 [inline]
RIP: 0010:block2mtd_setup2.isra.0+0x3c8/0xc70 drivers/mtd/devices/block2mtd.c:459
Code: 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 2b 08 00 00 48 8b 6d 08 31 ff 48 89 e8 48 c1 e0 09 48 99 <49> f7 ff 48 89 d6 48 89 54 24 10 e8 98 d5 4d fb 48 8b 54 24 10 48
RSP: 0018:ffffc90004ccf9f0 EFLAGS: 00010206
RAX: 0000000000100000 RBX: 1ffff92000999f41 RCX: ffffffff86bc9838
RDX: 0000000000000000 RSI: ffffffff86bc984a RDI: 0000000000000000
RBP: 0000000000000800 R08: 0000000000000005 R09: 000000000000001f
R10: 0000000000000007 R11: 0000000000000000 R12: ffffc90004ccfaa8
R13: 0000000000000000 R14: ffff8880254fe000 R15: 0000000000000000
FS:  000055558148e400(0000) GS:ffff8880d5dec000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055a8208cda78 CR3: 000000003ad58000 CR4: 0000000000352ef0
----------------
Code disassembly (best guess):
   0:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
   7:	fc ff df
   a:	48 89 fa             	mov    %rdi,%rdx
   d:	48 c1 ea 03          	shr    $0x3,%rdx
  11:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1)
  15:	0f 85 2b 08 00 00    	jne    0x846
  1b:	48 8b 6d 08          	mov    0x8(%rbp),%rbp
  1f:	31 ff                	xor    %edi,%edi
  21:	48 89 e8             	mov    %rbp,%rax
  24:	48 c1 e0 09          	shl    $0x9,%rax
  28:	48 99                	cqto
* 2a:	49 f7 ff             	idiv   %r15 <-- trapping instruction
  2d:	48 89 d6             	mov    %rdx,%rsi
  30:	48 89 54 24 10       	mov    %rdx,0x10(%rsp)
  35:	e8 98 d5 4d fb       	call   0xfb4dd5d2
  3a:	48 8b 54 24 10       	mov    0x10(%rsp),%rdx
  3f:	48                   	rex.W

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/11 17:15 upstream f5bbbfec59b4 3c5eaa21 .config console log report C ci-qemu-upstream divide error in block2mtd_setup2
2026/08/04 13:42 upstream 848acc8ffe1b 3c5eaa21 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root divide error in block2mtd_setup2
* Struck through repros no longer work on HEAD.