syzbot


UBSAN: shift-out-of-bounds in blkstol2

Status: fixed on 2023/06/08 14:41
Subsystems: jfs
[Documentation on labels]
Reported-by: syzbot+0be96567042453c0c820@syzkaller.appspotmail.com
Fix commit: fad376fce0af fs/jfs: fix shift exponent db_agl2size negative
First crash: 542d, last: 542d
Cause bisection: failed (error log, bisect log)
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] fs/jfs: fix shift exponent db_agl2size negative 1 (1) 2022/11/03 03:01
[syzbot] UBSAN: shift-out-of-bounds in blkstol2 0 (1) 2022/11/01 16:32

Sample crash report:
loop0: detected capacity change from 0 to 32768
================================================================================
UBSAN: shift-out-of-bounds in fs/jfs/jfs_dmap.c:2227:15
shift exponent -744642816 is negative
CPU: 0 PID: 3602 Comm: syz-executor202 Not tainted 6.1.0-rc1-next-20221021-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/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
 blkstol2.cold-0x5/0x26
 dbAllocDmap+0x61/0x110 fs/jfs/jfs_dmap.c:2009
 dbAllocDmapLev+0x158/0x2c0 fs/jfs/jfs_dmap.c:1963
 dbAllocCtl+0x131/0x780 fs/jfs/jfs_dmap.c:1803
 dbAllocAny+0x10e/0x1a0 fs/jfs/jfs_dmap.c:1517
 dbAlloc+0x46d/0xa70 fs/jfs/jfs_dmap.c:869
 ea_write+0x4ed/0xc90 fs/jfs/xattr.c:232
 ea_put fs/jfs/xattr.c:610 [inline]
 __jfs_setxattr+0xea9/0xfc0 fs/jfs/xattr.c:783
 __jfs_xattr_set+0xc9/0x150 fs/jfs/xattr.c:917
 __vfs_setxattr+0x115/0x180 fs/xattr.c:182
 __vfs_setxattr_noperm+0x125/0x5f0 fs/xattr.c:216
 __vfs_setxattr_locked+0x1cf/0x260 fs/xattr.c:277
 vfs_setxattr+0x13f/0x330 fs/xattr.c:309
 setxattr+0x146/0x160 fs/xattr.c:617
 path_setxattr+0x197/0x1c0 fs/xattr.c:636
 __do_sys_setxattr fs/xattr.c:652 [inline]
 __se_sys_setxattr fs/xattr.c:648 [inline]
 __x64_sys_setxattr+0xc0/0x160 fs/xattr.c:648
 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:0x7fa3cc94ee69
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007ffc339e1fe8 EFLAGS: 00000246 ORIG_RAX: 00000000000000bc
RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007fa3cc94ee69
RDX: 00000000200079c0 RSI: 0000000020004ec0 RDI: 0000000020004d40
RBP: 00007fa3cc90e630 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000000fffe R11: 0000000000000246 R12: 0000001200030083
R13: 0000000000000000 R14: 00083878000000f0 R15: 0000000000000000
 </TASK>
================================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/11/01 15:30 linux-next 4d48f589d294 a1d8560a .config strace log report syz C [disk image] [vmlinux] [mounted in repro] ci-upstream-linux-next-kasan-gce-root UBSAN: shift-out-of-bounds in blkstol2
2022/11/01 15:04 linux-next 4d48f589d294 a1d8560a .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root UBSAN: shift-out-of-bounds in blkstol2
* Struck through repros no longer work on HEAD.