syzbot


UBSAN: shift-out-of-bounds in init_sb (3)

Status: upstream: reported C repro on 2022/08/13 20:54
Reported-by: syzbot+dcf33a7aae997956fe06@syzkaller.appspotmail.com
Fix commit: gfs2: Check sb_bsize_shift after reading superblock
Patched on: [ci-upstream-linux-next-kasan-gce-root], missing on: [ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce ci-upstream-kmsan-gce-386 ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 54d, last: 4d21h
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream UBSAN: shift-out-of-bounds in init_sb 4 331d 459d 0/24 auto-closed as invalid on 2022/03/06 03:30
upstream UBSAN: shift-out-of-bounds in init_sb (2) 1 177d 173d 0/24 auto-closed as invalid on 2022/06/07 15:31

Sample crash report:
loop0: detected capacity change from 0 to 256
gfs2: fsid=loop0: Trying to join cluster "lock_nolock", "loop0"
gfs2: fsid=loop0: Now mounting FS (format 1801)...
================================================================================
UBSAN: shift-out-of-bounds in fs/gfs2/ops_fstype.c:295:19
shift exponent 4294967287 is too large for 64-bit type 'unsigned long'
CPU: 1 PID: 3614 Comm: syz-executor294 Not tainted 6.0.0-rc6-syzkaller-00210-gbf682942cd26 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1b1/0x28e lib/dump_stack.c:106
 ubsan_epilogue lib/ubsan.c:151 [inline]
 __ubsan_handle_shift_out_of_bounds+0x33d/0x3b0 lib/ubsan.c:322
 gfs2_read_sb fs/gfs2/ops_fstype.c:295 [inline]
 init_sb+0x11c6/0x12b0 fs/gfs2/ops_fstype.c:485
 gfs2_fill_super+0x18de/0x2610 fs/gfs2/ops_fstype.c:1207
 get_tree_bdev+0x400/0x620 fs/super.c:1323
 gfs2_get_tree+0x50/0x210 fs/gfs2/ops_fstype.c:1323
 vfs_get_tree+0x88/0x270 fs/super.c:1530
 do_new_mount+0x289/0xad0 fs/namespace.c:3040
 do_mount fs/namespace.c:3383 [inline]
 __do_sys_mount fs/namespace.c:3591 [inline]
 __se_sys_mount+0x2d3/0x3c0 fs/namespace.c:3568
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fa03a96b14a
Code: 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff040e7b88 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fff040e7be0 RCX: 00007fa03a96b14a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fff040e7ba0
RBP: 00007fff040e7ba0 R08: 00007fff040e7be0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000282 R12: 0000000020000218
R13: 0000000000000003 R14: 0000000000000004 R15: 0000000000000001
 </TASK>
================================================================================

Crashes (29):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-fs 2022/09/24 17:39 upstream bf682942cd26 0042f2b4 .config log report syz C UBSAN: shift-out-of-bounds in init_sb
ci-upstream-kasan-gce-root 2022/09/24 17:03 upstream a63f2e7cb110 0042f2b4 .config log report syz C UBSAN: shift-out-of-bounds in init_sb
ci-upstream-kasan-gce-root 2022/09/17 03:07 upstream 6879c2d3b960 dd9a85ff .config log report syz C UBSAN: shift-out-of-bounds in init_sb
ci-upstream-linux-next-kasan-gce-root 2022/09/15 15:39 linux-next e47eb90a0a9a dd9a85ff .config log report syz C UBSAN: shift-out-of-bounds in init_sb
ci-upstream-kasan-gce-smack-root 2022/09/28 06:56 upstream 46452d3786a8 75c78242 .config log report info UBSAN: shift-out-of-bounds in init_sb
ci2-upstream-fs 2022/09/28 02:11 upstream 46452d3786a8 75c78242 .config log report info UBSAN: shift-out-of-bounds in init_sb
ci2-upstream-fs 2022/09/27 02:30 upstream f76349cf4145 d59ba983 .config log report info UBSAN: shift-out-of-bounds in init_sb
ci2-upstream-fs 2022/09/25 18:48 upstream 105a36f3694e 0042f2b4 .config log report info UBSAN: shift-out-of-bounds in init_sb
ci2-upstream-fs 2022/09/25 18:10 upstream 105a36f3694e 0042f2b4 .config log report info UBSAN: shift-out-of-bounds in init_sb
ci2-upstream-fs 2022/09/25 04:20 upstream 3db61221f4e8 0042f2b4 .config log report info UBSAN: shift-out-of-bounds in init_sb
ci2-upstream-fs 2022/09/23 16:04 upstream bf682942cd26 0042f2b4 .config log report info UBSAN: shift-out-of-bounds in init_sb
ci-upstream-kasan-gce-smack-root 2022/09/22 20:49 upstream dc164f4fb00a 0042f2b4 .config log report info UBSAN: shift-out-of-bounds in init_sb
ci-upstream-kasan-gce-root 2022/09/22 20:44 upstream dc164f4fb00a 0042f2b4 .config log report info UBSAN: shift-out-of-bounds in init_sb
ci2-upstream-fs 2022/09/22 20:25 upstream dc164f4fb00a 0042f2b4 .config log report info UBSAN: shift-out-of-bounds in init_sb
ci-upstream-kasan-gce-selinux-root 2022/09/22 20:24 upstream dc164f4fb00a 0042f2b4 .config log report info UBSAN: shift-out-of-bounds in init_sb
ci2-upstream-fs 2022/09/20 21:44 upstream 60891ec99e14 c4b8ccfd .config log report info UBSAN: shift-out-of-bounds in init_sb
ci2-upstream-fs 2022/09/19 23:53 upstream 521a547ced64 dd9a85ff .config log report info UBSAN: shift-out-of-bounds in init_sb
ci2-upstream-fs 2022/09/19 13:58 upstream 521a547ced64 dd9a85ff .config log report info UBSAN: shift-out-of-bounds in init_sb
ci-upstream-kasan-gce-smack-root 2022/09/17 15:16 upstream a335366bad13 dd9a85ff .config log report info UBSAN: shift-out-of-bounds in init_sb
ci-upstream-kasan-gce-selinux-root 2022/09/17 15:16 upstream a335366bad13 dd9a85ff .config log report info UBSAN: shift-out-of-bounds in init_sb
ci-qemu-upstream 2022/09/17 15:15 upstream a335366bad13 dd9a85ff .config log report info UBSAN: shift-out-of-bounds in init_sb
ci-upstream-kasan-gce-root 2022/09/17 15:11 upstream a335366bad13 dd9a85ff .config log report info UBSAN: shift-out-of-bounds in init_sb
ci-upstream-kasan-gce-smack-root 2022/08/09 20:48 upstream 200e340f2196 c2a623d6 .config log report info UBSAN: shift-out-of-bounds in init_sb
ci-qemu-upstream-386 2022/09/22 20:41 upstream dc164f4fb00a 0042f2b4 .config log report info UBSAN: shift-out-of-bounds in init_sb
ci-qemu-upstream-386 2022/09/22 20:41 upstream dc164f4fb00a 0042f2b4 .config log report info UBSAN: shift-out-of-bounds in init_sb
ci-qemu-upstream-386 2022/09/17 15:33 upstream a335366bad13 dd9a85ff .config log report info UBSAN: shift-out-of-bounds in init_sb
ci-qemu-upstream-386 2022/09/17 15:16 upstream a335366bad13 dd9a85ff .config log report info UBSAN: shift-out-of-bounds in init_sb
ci-upstream-linux-next-kasan-gce-root 2022/09/17 15:15 linux-next e47eb90a0a9a dd9a85ff .config log report info UBSAN: shift-out-of-bounds in init_sb
ci-upstream-linux-next-kasan-gce-root 2022/09/15 15:26 linux-next e47eb90a0a9a dd9a85ff .config log report info UBSAN: shift-out-of-bounds in init_sb
* Struck through repros no longer work on HEAD.