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

4 views
Skip to first unread message

syzbot

unread,
Sep 30, 2024, 5:30:27 PM9/30/24
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3a5928702e71 Linux 5.15.167
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13135dd0580000
kernel config: https://syzkaller.appspot.com/x/.config?x=171882977b524c53
dashboard link: https://syzkaller.appspot.com/bug?extid=c6104ecfe56e0fd6b616
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/22ee27cb312d/disk-3a592870.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/90bf6a3e3d20/vmlinux-3a592870.xz
kernel image: https://storage.googleapis.com/syzbot-assets/096dd2c73ac3/Image-3a592870.gz.xz

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

loop4: detected capacity change from 0 to 32768
================================================================================
UBSAN: shift-out-of-bounds in fs/ocfs2/super.c:2342:10
shift exponent 4278976521 is too large for 32-bit type 'int'
CPU: 1 PID: 5089 Comm: syz.4.370 Not tainted 5.15.167-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call trace:
dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
dump_stack+0x1c/0x58 lib/dump_stack.c:113
ubsan_epilogue lib/ubsan.c:151 [inline]
__ubsan_handle_shift_out_of_bounds+0x2f8/0x378 lib/ubsan.c:321
ocfs2_verify_volume fs/ocfs2/super.c:2342 [inline]
ocfs2_sb_probe fs/ocfs2/super.c:793 [inline]
ocfs2_fill_super+0xe60/0x498c fs/ocfs2/super.c:989
mount_bdev+0x274/0x370 fs/super.c:1398
ocfs2_mount+0x44/0x58 fs/ocfs2/super.c:1187
legacy_get_tree+0xd4/0x16c fs/fs_context.c:611
vfs_get_tree+0x90/0x274 fs/super.c:1528
do_new_mount+0x278/0x8fc fs/namespace.c:3005
path_mount+0x594/0x101c fs/namespace.c:3335
do_mount fs/namespace.c:3348 [inline]
__do_sys_mount fs/namespace.c:3556 [inline]
__se_sys_mount fs/namespace.c:3533 [inline]
__arm64_sys_mount+0x510/0x5e0 fs/namespace.c:3533
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
================================================================================
================================================================================
UBSAN: shift-out-of-bounds in fs/ocfs2/super.c:2038:24
shift exponent 15990789 is too large for 32-bit type 'int'
CPU: 1 PID: 5089 Comm: syz.4.370 Not tainted 5.15.167-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call trace:
dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
dump_stack+0x1c/0x58 lib/dump_stack.c:113
ubsan_epilogue lib/ubsan.c:151 [inline]
__ubsan_handle_shift_out_of_bounds+0x2f8/0x378 lib/ubsan.c:321
ocfs2_initialize_super fs/ocfs2/super.c:2038 [inline]
ocfs2_fill_super+0x4194/0x498c fs/ocfs2/super.c:995
mount_bdev+0x274/0x370 fs/super.c:1398
ocfs2_mount+0x44/0x58 fs/ocfs2/super.c:1187
legacy_get_tree+0xd4/0x16c fs/fs_context.c:611
vfs_get_tree+0x90/0x274 fs/super.c:1528
do_new_mount+0x278/0x8fc fs/namespace.c:3005
path_mount+0x594/0x101c fs/namespace.c:3335
do_mount fs/namespace.c:3348 [inline]
__do_sys_mount fs/namespace.c:3556 [inline]
__se_sys_mount fs/namespace.c:3533 [inline]
__arm64_sys_mount+0x510/0x5e0 fs/namespace.c:3533
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
================================================================================
(syz.4.370,5089,1):ocfs2_init_global_system_inodes:462 ERROR: status = -22
(syz.4.370,5089,1):ocfs2_init_global_system_inodes:464 ERROR: Unable to load system inode 2, possibly corrupt fs?
(syz.4.370,5089,1):ocfs2_init_global_system_inodes:473 ERROR: status = -22
(syz.4.370,5089,1):ocfs2_initialize_super:2278 ERROR: status = -22
(syz.4.370,5089,1):ocfs2_fill_super:1177 ERROR: status = -22


---
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 report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

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

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

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

syzbot

unread,
Sep 30, 2024, 7:15:29 PM9/30/24
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 3a5928702e71 Linux 5.15.167
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=120e1980580000
kernel config: https://syzkaller.appspot.com/x/.config?x=171882977b524c53
dashboard link: https://syzkaller.appspot.com/bug?extid=c6104ecfe56e0fd6b616
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=176f5dd0580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1128f127980000
mounted in repro: https://storage.googleapis.com/syzbot-assets/a55875ee0c9d/mount_0.gz

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

option from the mount to silence this warning.
=======================================================
================================================================================
UBSAN: shift-out-of-bounds in fs/ocfs2/super.c:2342:10
shift exponent 4278976521 is too large for 32-bit type 'int'
CPU: 1 PID: 4021 Comm: syz-executor465 Not tainted 5.15.167-syzkaller #0
CPU: 1 PID: 4021 Comm: syz-executor465 Not tainted 5.15.167-syzkaller #0
(syz-executor465,4021,1):ocfs2_init_global_system_inodes:462 ERROR: status = -22
(syz-executor465,4021,1):ocfs2_init_global_system_inodes:464 ERROR: Unable to load system inode 2, possibly corrupt fs?
(syz-executor465,4021,1):ocfs2_init_global_system_inodes:473 ERROR: status = -22
(syz-executor465,4021,1):ocfs2_initialize_super:2278 ERROR: status = -22
(syz-executor465,4021,1):ocfs2_fill_super:1177 ERROR: status = -22


---
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.

syzbot

unread,
Feb 21, 2025, 6:28:05 AM2/21/25
to syzkaller...@googlegroups.com
syzbot suspects this issue could be fixed by backporting the following commit:

commit 7f86b2942791012ac7b4c481d1f84a58fd2fbcfc
git tree: upstream
Author: qasdev <qasd...@gmail.com>
Date: Tue Aug 20 01:22:09 2024 +0000

ocfs2: fix shift-out-of-bounds UBSAN bug in ocfs2_verify_volume()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=10eae7f8580000
kernel config: https://syzkaller.appspot.com/x/.config?x=8c3b695ffd9247a0
dashboard link: https://syzkaller.appspot.com/bug?extid=c6104ecfe56e0fd6b616
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10044618580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1076d9df980000


Please keep in mind that other backports might be required as well.

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages