syzbot


UBSAN: shift-out-of-bounds in nilfs_load_super_block

Status: fixed on 2023/02/24 13:50
Subsystems: nilfs
[Documentation on labels]
Reported-by: syzbot+e91619dd4c11c4960706@syzkaller.appspotmail.com
Fix commit: 610a2a3d7d8b nilfs2: fix shift-out-of-bounds/overflow in nilfs_sb2_bad_offset()
First crash: 549d, last: 539d
Cause bisection: failed (error log, bisect log)
  
Discussions (10)
Title Replies (including bot) Last reply
[PATCH AUTOSEL 6.1 01/22] fs: jfs: fix shift-out-of-bounds in dbAllocAG 24 (24) 2022/12/18 11:28
[PATCH AUTOSEL 6.0 01/16] fs: jfs: fix shift-out-of-bounds in dbAllocAG 18 (18) 2022/12/18 11:26
[PATCH AUTOSEL 5.4 1/9] fs: jfs: fix shift-out-of-bounds in dbAllocAG 10 (10) 2022/12/17 18:05
[PATCH AUTOSEL 4.9 1/8] fs: jfs: fix shift-out-of-bounds in dbAllocAG 8 (8) 2022/12/17 15:30
[PATCH AUTOSEL 4.14 1/8] fs: jfs: fix shift-out-of-bounds in dbAllocAG 8 (8) 2022/12/17 15:30
[PATCH AUTOSEL 4.19 1/8] fs: jfs: fix shift-out-of-bounds in dbAllocAG 8 (8) 2022/12/17 15:30
[PATCH AUTOSEL 5.10 1/9] fs: jfs: fix shift-out-of-bounds in dbAllocAG 9 (9) 2022/12/17 15:29
[PATCH AUTOSEL 5.15 01/10] fs: jfs: fix shift-out-of-bounds in dbAllocAG 10 (10) 2022/12/17 15:29
[PATCH 0/2] nilfs2: fix UBSAN shift-out-of-bounds warnings on mount time 3 (3) 2022/10/27 04:43
[syzbot] UBSAN: shift-out-of-bounds in nilfs_load_super_block 0 (1) 2022/10/25 17:54

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