syzbot


UBSAN: shift-out-of-bounds in nilfs_load_super_block

Status: upstream: reported C repro on 2022/10/25 17:54
Reported-by: syzbot+e91619dd4c11c4960706@syzkaller.appspotmail.com
Fix commit: 610a2a3d7d8b nilfs2: fix shift-out-of-bounds/overflow in nilfs_sb2_bad_offset()
Patched on: [ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte 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-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu2-riscv64]
First crash: 104d, last: 94d

Cause bisection: failed (bisect log)

Sample crash report:
loop0: detected capacity change from 0 to 4192
================================================================================
UBSAN: shift-out-of-bounds in fs/nilfs2/the_nilfs.c:449:46
shift exponent 38983 is too large for 64-bit type 'long long unsigned int'
CPU: 0 PID: 3606 Comm: syz-executor394 Not tainted 6.1.0-rc3-syzkaller-00158-gee6050c8af96 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 ubsan_epilogue+0xb/0x50 lib/ubsan.c:151
 __ubsan_handle_shift_out_of_bounds.cold+0xb1/0x187 lib/ubsan.c:322
 nilfs_sb2_bad_offset fs/nilfs2/the_nilfs.c:449 [inline]
 nilfs_load_super_block.cold+0x17/0x1c fs/nilfs2/the_nilfs.c:523
 init_nilfs+0xb3/0x1280 fs/nilfs2/the_nilfs.c:577
 nilfs_fill_super fs/nilfs2/super.c:1047 [inline]
 nilfs_mount+0x868/0xfb0 fs/nilfs2/super.c:1317
 legacy_get_tree+0x105/0x220 fs/fs_context.c:610
 vfs_get_tree+0x89/0x2f0 fs/super.c:1531
 do_new_mount fs/namespace.c:3040 [inline]
 path_mount+0x1326/0x1e20 fs/namespace.c:3370
 do_mount fs/namespace.c:3383 [inline]
 __do_sys_mount fs/namespace.c:3591 [inline]
 __se_sys_mount fs/namespace.c:3568 [inline]
 __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f283948c65a
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:00007ffdd0ab1488 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f283948c65a
RDX: 00000000200000c0 RSI: 0000000020000100 RDI: 00007ffdd0ab14a0
RBP: 00007ffdd0ab14a0 R08: 00007ffdd0ab14e0 R09: 00005555560402c0
R10: 0000000000010400 R11: 0000000000000286 R12: 0000000000000004
R13: 00007ffdd0ab14e0 R14: 000000000000003a R15: 0000000020000770
 </TASK>
================================================================================

Crashes (3):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci-upstream-kasan-gce-root 2022/11/04 19:18 upstream ee6050c8af96 6d752409 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] UBSAN: shift-out-of-bounds in nilfs_load_super_block
ci2-upstream-fs 2022/10/25 17:44 upstream 337a0a0b63f1 45645420 .config strace log report syz C [disk image] [vmlinux] [mounted in repro] UBSAN: shift-out-of-bounds in nilfs_load_super_block
ci2-upstream-fs 2022/10/25 17:36 upstream 337a0a0b63f1 45645420 .config console log report info [disk image] [vmlinux] UBSAN: shift-out-of-bounds in nilfs_load_super_block
* Struck through repros no longer work on HEAD.