syzbot


UBSAN: shift-out-of-bounds in erofs_fc_fill_super

Status: fixed on 2021/04/09 19:46
Subsystems: erofs
[Documentation on labels]
Reported-by: syzbot+c68f467cd7c45860e8d4@syzkaller.appspotmail.com
Fix commit: bde545295b71 erofs: fix shift-out-of-bounds of blkszbits
First crash: 1361d, last: 1327d
Cause bisection: introduced by (bisect log) [release commit]:
commit 4d856f72c10ecb060868ed10ff1b1453943fc6c8
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Sun Sep 15 21:19:32 2019 +0000

  Linux 5.3

Crash: UBSAN: undefined-behaviour in erofs_fill_super (log)
Repro: C syz .config
  
Discussions (8)
Title Replies (including bot) Last reply
[PATCH 5.10 000/102] 5.10.21-rc1 review 119 (119) 2021/03/08 13:21
[PATCH 5.11 000/104] 5.11.4-rc1 review 119 (119) 2021/03/07 11:37
[PATCH AUTOSEL 5.11 01/67] ath10k: prevent deinitializing NAPI twice 80 (80) 2021/03/06 17:52
[PATCH 5.4 00/72] 5.4.103-rc1 review 80 (80) 2021/03/06 16:33
[PATCH AUTOSEL 5.10 01/56] EDAC/amd64: Do not load on family 0x15, model 0x13 59 (59) 2021/03/05 12:40
[PATCH AUTOSEL 5.4 01/40] staging: fwserial: Fix error handling in fwserial_create 41 (41) 2021/02/24 13:20
[PATCH] erofs: fix shift-out-of-bounds of blkszbits 3 (3) 2021/02/11 01:15
UBSAN: shift-out-of-bounds in erofs_fc_fill_super 0 (1) 2021/01/19 17:38

Sample crash report:
loop0: detected capacity change from 4 to 0
================================================================================
UBSAN: shift-out-of-bounds in fs/erofs/super.c:161:3
shift exponent 59 is too large for 32-bit type 'int'
CPU: 1 PID: 8462 Comm: syz-executor591 Not tainted 5.11.0-rc3-next-20210115-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+0x107/0x163 lib/dump_stack.c:120
 ubsan_epilogue+0xb/0x5a lib/ubsan.c:148
 __ubsan_handle_shift_out_of_bounds.cold+0xb1/0x181 lib/ubsan.c:395
 erofs_read_superblock fs/erofs/super.c:161 [inline]
 erofs_fc_fill_super.cold+0x6c/0x35c fs/erofs/super.c:357
 get_tree_bdev+0x440/0x760 fs/super.c:1291
 vfs_get_tree+0x89/0x2f0 fs/super.c:1496
 do_new_mount fs/namespace.c:2889 [inline]
 path_mount+0x12ae/0x1e70 fs/namespace.c:3220
 do_mount fs/namespace.c:3233 [inline]
 __do_sys_mount fs/namespace.c:3441 [inline]
 __se_sys_mount fs/namespace.c:3418 [inline]
 __x64_sys_mount+0x27f/0x300 fs/namespace.c:3418
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x446d1a
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:00007fff68419868 EFLAGS: 00000297 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fff684198c0 RCX: 0000000000446d1a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fff68419880
RBP: 00007fff68419880 R08: 00007fff684198c0 R09: 00007fff00000015
R10: 0000000000000000 R11: 0000000000000297 R12: 0000000000000001
R13: 0000000000000004 R14: 0000000000000003 R15: 0000000000000003
================================================================================

Crashes (11):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/01/15 23:53 linux-next b3a3cbdec55b 65a7a854 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2021/02/18 19:22 upstream f40ddce88593 14052202 .config console log report info ci-upstream-kasan-gce-root UBSAN: shift-out-of-bounds in erofs_fc_fill_super
2021/02/18 02:51 upstream f40ddce88593 14052202 .config console log report info ci-upstream-kasan-gce-root UBSAN: shift-out-of-bounds in erofs_fc_fill_super
2021/02/17 15:39 upstream f40ddce88593 052f8d9f .config console log report info ci-upstream-kasan-gce-root UBSAN: shift-out-of-bounds in erofs_fc_fill_super
2021/02/15 20:46 upstream f40ddce88593 98682e5e .config console log report info ci-upstream-kasan-gce-selinux-root UBSAN: shift-out-of-bounds in erofs_fc_fill_super
2021/02/15 20:13 upstream f40ddce88593 98682e5e .config console log report info ci-upstream-kasan-gce-smack-root UBSAN: shift-out-of-bounds in erofs_fc_fill_super
2021/02/15 12:39 upstream f40ddce88593 98682e5e .config console log report info ci-upstream-kasan-gce-selinux-root UBSAN: shift-out-of-bounds in erofs_fc_fill_super
2021/01/29 03:05 upstream e5ff2cb9cf67 7df34f59 .config console log report info ci-upstream-kasan-gce-smack-root UBSAN: shift-out-of-bounds in erofs_fc_fill_super
2021/01/29 03:05 upstream e5ff2cb9cf67 7df34f59 .config console log report info ci-upstream-kasan-gce-smack-root UBSAN: shift-out-of-bounds in erofs_fc_fill_super
2021/01/29 02:43 upstream e5ff2cb9cf67 7df34f59 .config console log report info ci-upstream-kasan-gce-root UBSAN: shift-out-of-bounds in erofs_fc_fill_super
2021/01/15 17:59 linux-next b3a3cbdec55b 65a7a854 .config console log report info ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.