syzbot


UBSAN: shift-out-of-bounds in dbMount

Status: upstream: reported C repro on 2022/11/13 15:39
Subsystems: jfs (incorrect?)
Reported-by: syzbot+0835e526215d5dcefaa9@syzkaller.appspotmail.com
First crash: 136d, last: 41d

Cause bisection: introduced by (bisect log) [merge commit]:
commit 01bf246a20c7664ae41cdbefd0314d0fb67d63e9
Author: David S. Miller <davem@davemloft.net>
Date: Wed Sep 21 12:50:03 2022 +0000

  Merge branch 'net-dev_err_probe'

Crash: KASAN: use-after-free Read in copy_page_from_iter_atomic (log)
Repro: C syz .config

Fix bisection: fixed by (bisect log) :
commit fad376fce0af58deebc5075b8539dc05bf639af3
Author: Liu Shixin via Jfs-discussion <jfs-discussion@lists.sourceforge.net>
Date: Thu Nov 3 03:01:59 2022 +0000

  fs/jfs: fix shift exponent db_agl2size negative


Sample crash report:
loop0: detected capacity change from 0 to 32768
================================================================================
UBSAN: shift-out-of-bounds in fs/jfs/jfs_dmap.c:201:29
shift exponent -1368651876 is negative
CPU: 1 PID: 5245 Comm: syz-executor195 Not tainted 6.1.0-rc4-next-20221111-syzkaller #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
 dbMount.cold+0x17/0x38 fs/jfs/jfs_dmap.c:201
 jfs_mount+0x263/0x7b0 fs/jfs/jfs_mount.c:121
 jfs_fill_super+0x5a4/0xc70 fs/jfs/super.c:556
 mount_bdev+0x34d/0x410 fs/super.c:1401
 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:3145 [inline]
 path_mount+0x1326/0x1e20 fs/namespace.c:3475
 do_mount fs/namespace.c:3488 [inline]
 __do_sys_mount fs/namespace.c:3696 [inline]
 __se_sys_mount fs/namespace.c:3673 [inline]
 __x64_sys_mount+0x27f/0x300 fs/namespace.c:3673
 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:0x7fea10c7d1fa
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:00007fff879d2458 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fea10c7d1fa
RDX: 0000000020005380 RSI: 0000000020000100 RDI: 00007fff879d2470
RBP: 00007fff879d2470 R08: 00007fff879d24b0 R09: 0000555556ef52c0
R10: 0000000000000000 R11: 0000000000000282 R12: 0000000000000004
R13: 00007fff879d24b0 R14: 0000000000000358 R15: 0000000020005240
 </TASK>
================================================================================

Crashes (5):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci-upstream-linux-next-kasan-gce-root 2022/11/13 04:25 linux-next f8f60f322f06 3ead01ad .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] UBSAN: shift-out-of-bounds in dbMount
ci-upstream-kasan-gce-root 2023/02/08 06:54 upstream 513c1a3d3f19 15c3d445 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] UBSAN: shift-out-of-bounds in dbMount
ci2-upstream-fs 2023/02/15 19:40 upstream e1c04510f521 6be0f1f5 .config console log report info [disk image] [vmlinux] [kernel image] UBSAN: shift-out-of-bounds in dbMount
ci-upstream-kasan-gce-root 2023/01/31 18:30 upstream 22b8077d0fce 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] UBSAN: shift-out-of-bounds in dbMount
ci2-upstream-fs 2023/01/24 04:28 upstream 7bf70dbb1882 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] UBSAN: shift-out-of-bounds in dbMount
* Struck through repros no longer work on HEAD.