[v5.15] UBSAN: shift-out-of-bounds in dbFree

1 view
Skip to first unread message

syzbot

unread,
Apr 30, 2023, 1:13:48 AM4/30/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: f48aeeaaa64c Linux 5.15.109
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13808158280000
kernel config: https://syzkaller.appspot.com/x/.config?x=f0ea19992afd55ad
dashboard link: https://syzkaller.appspot.com/bug?extid=bf252a2ef94acc14ceef
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10740608280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1273e240280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/fd82b060cee7/disk-f48aeeaa.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b216234bd1a0/vmlinux-f48aeeaa.xz
kernel image: https://storage.googleapis.com/syzbot-assets/c0609f7a6703/bzImage-f48aeeaa.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/86f0c5f2392e/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+bf252a...@syzkaller.appspotmail.com

find_entry called with index = 0
read_mapping_page failed!
ERROR: (device loop0): txCommit:
ERROR: (device loop0): remounting filesystem as read-only
================================================================================
UBSAN: shift-out-of-bounds in fs/jfs/jfs_dmap.c:381:12
shift exponent 134217736 is too large for 64-bit type 'long long'
CPU: 1 PID: 3498 Comm: syz-executor324 Not tainted 5.15.109-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
ubsan_epilogue lib/ubsan.c:151 [inline]
__ubsan_handle_shift_out_of_bounds+0x3bf/0x420 lib/ubsan.c:321
dbFree+0x46a/0x650 fs/jfs/jfs_dmap.c:381
txFreeMap+0x966/0xd50 fs/jfs/jfs_txnmgr.c:2544
xtTruncate+0xe58/0x3260 fs/jfs/jfs_xtree.c:3428
jfs_free_zero_link+0x46a/0x6e0 fs/jfs/namei.c:758
jfs_evict_inode+0x35b/0x440 fs/jfs/inode.c:153
evict+0x2a4/0x620 fs/inode.c:587
__dentry_kill+0x436/0x650 fs/dcache.c:582
shrink_dentry_list+0x398/0x6a0 fs/dcache.c:1176
shrink_dcache_parent+0xc9/0x480
do_one_tree+0x23/0xe0 fs/dcache.c:1657
shrink_dcache_for_umount+0x79/0x120 fs/dcache.c:1674
generic_shutdown_super+0x66/0x2c0 fs/super.c:447
kill_block_super+0x7a/0xe0 fs/super.c:1405
deactivate_locked_super+0xa0/0x110 fs/super.c:335
cleanup_mnt+0x44e/0x500 fs/namespace.c:1143
task_work_run+0x129/0x1a0 kernel/task_work.c:164
exit_task_work include/linux/task_work.h:32 [inline]
do_exit+0x6a3/0x2480 kernel/exit.c:872
do_group_exit+0x144/0x310 kernel/exit.c:994
__do_sys_exit_group kernel/exit.c:1005 [inline]
__se_sys_exit_group kernel/exit.c:1003 [inline]
__x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1003
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+0x61/0xcb
RIP: 0033:0x7f4af666a9c9
Code: Unable to access opcode bytes at RIP 0x7f4af666a99f.
RSP: 002b:00007ffed1092878 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007f4af66e5330 RCX: 00007f4af666a9c9
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000001
RBP: 0000000000000001 R08: ffffffffffffffc0 R09: 00007f4af66dfe40
R10: 00007ffed1092790 R11: 0000000000000246 R12: 00007f4af66e5330
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001
</TASK>
================================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to change bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the bug is a duplicate of another bug, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
May 2, 2023, 2:17:44 AM5/2/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: ca48fc16c493 Linux 6.1.27
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15b30010280000
kernel config: https://syzkaller.appspot.com/x/.config?x=47d3bbfdb3b1ddd2
dashboard link: https://syzkaller.appspot.com/bug?extid=57411692ac6c84ac57cf
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10e33ca0280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11bbbf0c280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/658765c915fa/disk-ca48fc16.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d69e8a1aff2d/vmlinux-ca48fc16.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0317a9546209/bzImage-ca48fc16.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/8d1f0bd2c0fa/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+574116...@syzkaller.appspotmail.com

ERROR: (device loop0): txCommit:
ERROR: (device loop0): remounting filesystem as read-only
================================================================================
UBSAN: shift-out-of-bounds in fs/jfs/jfs_dmap.c:381:12
shift exponent 134217736 is too large for 64-bit type 'long long'
CPU: 0 PID: 3540 Comm: syz-executor912 Not tainted 6.1.27-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
ubsan_epilogue lib/ubsan.c:151 [inline]
__ubsan_handle_shift_out_of_bounds+0x3bf/0x420 lib/ubsan.c:321
dbFree+0x46a/0x650 fs/jfs/jfs_dmap.c:381
txFreeMap+0x966/0xd50 fs/jfs/jfs_txnmgr.c:2510
xtTruncate+0xe58/0x3260 fs/jfs/jfs_xtree.c:2467
jfs_free_zero_link+0x46a/0x6e0 fs/jfs/namei.c:758
jfs_evict_inode+0x35b/0x440 fs/jfs/inode.c:153
evict+0x2a4/0x620 fs/inode.c:664
__dentry_kill+0x436/0x650 fs/dcache.c:607
shrink_dentry_list+0x398/0x6a0 fs/dcache.c:1201
shrink_dcache_parent+0xc9/0x480
do_one_tree+0x23/0xe0 fs/dcache.c:1682
shrink_dcache_for_umount+0x79/0x120 fs/dcache.c:1699
generic_shutdown_super+0x63/0x340 fs/super.c:473
kill_block_super+0x7a/0xe0 fs/super.c:1450
deactivate_locked_super+0xa0/0x110 fs/super.c:332
cleanup_mnt+0x490/0x520 fs/namespace.c:1186
task_work_run+0x246/0x300 kernel/task_work.c:179
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0x6fb/0x2300 kernel/exit.c:869
do_group_exit+0x202/0x2b0 kernel/exit.c:1019
__do_sys_exit_group kernel/exit.c:1030 [inline]
__se_sys_exit_group kernel/exit.c:1028 [inline]
__x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1028
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:0x7f544b4c69c9
Code: Unable to access opcode bytes at 0x7f544b4c699f.
RSP: 002b:00007ffe6afb1ea8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007f544b541330 RCX: 00007f544b4c69c9
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000001
RBP: 0000000000000001 R08: ffffffffffffffc0 R09: 00007f544b53be40
R10: 00007ffe6afb1dc0 R11: 0000000000000246 R12: 00007f544b541330

syzbot

unread,
Sep 14, 2023, 1:20:45 PM9/14/23
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit de984faecddb900fa850af4df574a25b32bb93f5
Author: Siddh Raman Pant <co...@siddh.me>
Date: Tue Jun 20 16:47:00 2023 +0000

jfs: jfs_dmap: Validate db_l2nbperpage while mounting

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=11cf4a8c680000
start commit: f48aeeaaa64c Linux 5.15.109
git tree: linux-5.15.y
If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: jfs: jfs_dmap: Validate db_l2nbperpage while mounting

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

syzbot

unread,
Sep 19, 2023, 12:59:35 PM9/19/23
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit c7feb54b113802d2aba98708769d3c33fb017254
Author: Siddh Raman Pant <co...@siddh.me>
Date: Tue Jun 20 16:47:00 2023 +0000

jfs: jfs_dmap: Validate db_l2nbperpage while mounting

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=15c78318680000
start commit: ca48fc16c493 Linux 6.1.27
git tree: linux-6.1.y
Reply all
Reply to author
Forward
0 new messages