syzbot


UBSAN: shift-out-of-bounds in ext4_mb_init

Status: fixed on 2021/11/10 00:50
Subsystems: ext4
[Documentation on labels]
Reported-by: syzbot+a8b4b0c60155e87e9484@syzkaller.appspotmail.com
Fix commit: f91436d55a27 fs/ext4: fix integer overflow in s_log_groups_per_flex
First crash: 1180d, last: 1169d
Cause bisection: introduced by (bisect log) :
commit cfd73237722135807967f389bcbda558a60a30d6
Author: Alex Zhuravlev <bzzz@whamcloud.com>
Date: Tue Apr 21 07:54:07 2020 +0000

  ext4: add prefetching for block allocation bitmaps

Crash: UBSAN: shift-out-of-bounds in ext4_mb_init (log)
Repro: C syz .config
  
Discussions (6)
Title Replies (including bot) Last reply
[PATCH AUTOSEL 5.11 01/44] virtiofs: Fail dax mount if device does not support it 57 (57) 2021/03/30 21:15
[PATCH 5.11 000/254] 5.11.11-rc1 review 267 (267) 2021/03/29 14:13
[PATCH 5.10 000/221] 5.10.27-rc1 review 224 (224) 2021/03/29 11:47
[PATCH AUTOSEL 5.10 01/39] virtiofs: Fail dax mount if device does not support it 39 (39) 2021/03/25 11:25
[PATCH] fs/ext4: fix integer overflow in s_log_groups_per_flex 5 (5) 2021/03/05 14:32
UBSAN: shift-out-of-bounds in ext4_mb_init 0 (1) 2021/02/01 09:16
Last patch testing requests (1)
Created Duration User Patch Repo Result
2021/02/03 13:11 18m snovitoll@gmail.com https://linux.googlesource.com/linux/kernel/git/torvalds/linux refs/changes/57/8057/1 OK

Sample crash report:
loop0: detected capacity change from 264192 to 0
================================================================================
UBSAN: shift-out-of-bounds in fs/ext4/mballoc.c:2713:24
shift exponent 60 is too large for 32-bit type 'int'
CPU: 1 PID: 8433 Comm: syz-executor484 Not tainted 5.11.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x137/0x1be lib/dump_stack.c:120
 ubsan_epilogue lib/ubsan.c:148 [inline]
 __ubsan_handle_shift_out_of_bounds+0x432/0x4d0 lib/ubsan.c:395
 ext4_mb_init_backend fs/ext4/mballoc.c:2713 [inline]
 ext4_mb_init+0x19bc/0x19f0 fs/ext4/mballoc.c:2898
 ext4_fill_super+0xc2ec/0xfbe0 fs/ext4/super.c:4983
 mount_bdev+0x26c/0x3a0 fs/super.c:1366
 legacy_get_tree+0xea/0x180 fs/fs_context.c:592
 vfs_get_tree+0x86/0x270 fs/super.c:1496
 do_new_mount fs/namespace.c:2881 [inline]
 path_mount+0x17ad/0x2a00 fs/namespace.c:3211
 do_mount fs/namespace.c:3224 [inline]
 __do_sys_mount fs/namespace.c:3432 [inline]
 __se_sys_mount+0x28c/0x320 fs/namespace.c:3409
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x44710a
Code: b8 08 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 fd ad fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 da ad fb ff c3 66 0f 1f 84 00 00 00 00 00
RSP: 002b:00007ffc5b95ff48 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffc5b95ffa0 RCX: 000000000044710a
RDX: 0000000020000000 RSI: 0000000020000180 RDI: 00007ffc5b95ff60
RBP: 00007ffc5b95ff60 R08: 00007ffc5b95ffa0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000013
R13: 0000000000000004 R14: 0000000000000003 R15: 0000000000000003
================================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/01/31 19:42 upstream 6642d600b541 fc9fd31e .config console log report syz C ci-upstream-kasan-gce-smack-root UBSAN: shift-out-of-bounds in ext4_mb_init
2021/02/12 05:05 upstream 291009f656e8 a5f86b15 .config console log report info ci-upstream-kasan-gce-root UBSAN: shift-out-of-bounds in ext4_mb_init
2021/02/11 23:03 upstream 291009f656e8 a5f86b15 .config console log report info ci-upstream-kasan-gce-smack-root UBSAN: shift-out-of-bounds in ext4_mb_init
2021/01/31 19:20 upstream 6642d600b541 fc9fd31e .config console log report info ci-upstream-kasan-gce-smack-root UBSAN: shift-out-of-bounds in ext4_mb_init
2021/02/04 20:35 linux-next 0e2c50f40b7f 42b90a7c .config console log report info ci-upstream-linux-next-kasan-gce-root UBSAN: shift-out-of-bounds in ext4_mb_init
* Struck through repros no longer work on HEAD.