syzbot


divide error in do_journal_end (2)

Status: fixed on 2021/11/10 00:50
Reported-by: syzbot+0ba9909df31c6a36974d@syzkaller.appspotmail.com
Fix commit: a149127be52f reiserfs: add check for invalid 1st journal block
First crash: 503d, last: 503d

Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: divide error in do_journal_end (log)
Repro: C syz .config
similar bugs (5):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream divide error in do_journal_end 2 676d 704d 0/24 auto-closed as invalid on 2021/03/19 22:00
linux-4.14 divide error in do_journal_end (2) C 1 28d 517d 0/1 upstream: reported C repro on 2021/04/28 16:52
linux-4.19 divide error in do_journal_end (2) C done 4 443d 553d 1/1 fixed on 2021/08/12 11:53
linux-4.14 divide error in do_journal_end C done 1 627d 687d 1/1 fixed on 2021/02/21 17:18
linux-4.19 divide error in do_journal_end C done 2 638d 698d 1/1 fixed on 2021/01/27 05:38
Patch testing requests:
Created Duration User Patch Repo Result
2021/05/14 20:42 16m paskripkin@gmail.com https://linux.googlesource.com/linux/kernel/git/torvalds/linux refs/changes/96/11096/1 OK

Sample crash report:
REISERFS (device loop0): journal params: device loop0, size 8192, journal first block 10, max trans len 1024, max batch 900, max commit age 30, max trans age 30
REISERFS (device loop0): checking transaction log (loop0)
REISERFS (device loop0): Using r5 hash to sort names
REISERFS (device loop0): Created .reiserfs_priv - reserved for xattr storage.
divide error: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 8393 Comm: syz-executor119 Not tainted 5.13.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:do_journal_end+0x24aa/0x4950 fs/reiserfs/journal.c:4188
Code: c1 45 84 ca 0f 85 67 18 00 00 83 e2 07 40 38 d6 41 0f 9e c1 40 84 f6 0f 95 c2 41 84 d1 0f 85 4e 18 00 00 41 8b 7c 24 14 31 d2 <48> f7 f7 49 8d 7d 18 48 8d 34 0a 48 89 f8 48 c1 e8 03 80 3c 18 00
RSP: 0018:ffffc9000187faa0 EFLAGS: 00010246
RAX: 0000000000000005 RBX: dffffc0000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc900016c1048 R08: 0000000000001000 R09: 0000000000000001
R10: 0000000000000001 R11: 0000000000000000 R12: ffff8880349b1000
R13: ffff8880285b9000 R14: ffff88801248d4c0 R15: ffff888019b28000
FS:  0000000000000000(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055cf21e91b70 CR3: 0000000013782000 CR4: 0000000000350ef0
Call Trace:
 reiserfs_sync_fs+0xf8/0x120 fs/reiserfs/super.c:78
 __sync_filesystem fs/sync.c:39 [inline]
 sync_filesystem fs/sync.c:67 [inline]
 sync_filesystem+0x1b5/0x260 fs/sync.c:48
 generic_shutdown_super+0x70/0x370 fs/super.c:448
 kill_block_super+0x97/0xf0 fs/super.c:1395
 deactivate_locked_super+0x94/0x160 fs/super.c:335
 deactivate_super+0xad/0xd0 fs/super.c:366
 cleanup_mnt+0x3a2/0x540 fs/namespace.c:1136
 task_work_run+0xdd/0x1a0 kernel/task_work.c:164
 exit_task_work include/linux/task_work.h:32 [inline]
 do_exit+0xbfc/0x2a60 kernel/exit.c:826
 do_group_exit+0x125/0x310 kernel/exit.c:923
 __do_sys_exit_group kernel/exit.c:934 [inline]
 __se_sys_exit_group kernel/exit.c:932 [inline]
 __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:932
 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x4438c9
Code: Unable to access opcode bytes at RIP 0x44389f.
RSP: 002b:00007ffe1e8a33f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00000000004b52f0 RCX: 00000000004438c9
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000001
RBP: 0000000000000001 R08: ffffffffffffffc4 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004b52f0
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001
Modules linked in:
---[ end trace 918df66ba4209fe1 ]---
RIP: 0010:do_journal_end+0x24aa/0x4950 fs/reiserfs/journal.c:4188
Code: c1 45 84 ca 0f 85 67 18 00 00 83 e2 07 40 38 d6 41 0f 9e c1 40 84 f6 0f 95 c2 41 84 d1 0f 85 4e 18 00 00 41 8b 7c 24 14 31 d2 <48> f7 f7 49 8d 7d 18 48 8d 34 0a 48 89 f8 48 c1 e8 03 80 3c 18 00
RSP: 0018:ffffc9000187faa0 EFLAGS: 00010246
RAX: 0000000000000005 RBX: dffffc0000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc900016c1048 R08: 0000000000001000 R09: 0000000000000001
R10: 0000000000000001 R11: 0000000000000000 R12: ffff8880349b1000
R13: ffff8880285b9000 R14: ffff88801248d4c0 R15: ffff888019b28000
FS:  0000000000000000(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055cf21e91b70 CR3: 00000000133f2000 CR4: 0000000000350ef0

Crashes (2):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2021/05/11 22:52 upstream 88b06399c9c7 b3c3bb8e .config log report syz C divide error in do_journal_end
ci-upstream-kasan-gce-root 2021/05/11 21:15 upstream 88b06399c9c7 b3c3bb8e .config log report info divide error in do_journal_end
* Struck through repros no longer work on HEAD.