[v6.1] UBSAN: shift-out-of-bounds in minix_statfs

4 views
Skip to first unread message

syzbot

unread,
Nov 9, 2024, 6:46:30 AM11/9/24
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d7039b844a1c Linux 6.1.116
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13e99e30580000
kernel config: https://syzkaller.appspot.com/x/.config?x=e70423a11a31a773
dashboard link: https://syzkaller.appspot.com/bug?extid=e8422ab0c2a90434ef95
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/3797d90cbed7/disk-d7039b84.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/9726bc0bc28f/vmlinux-d7039b84.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0b4bbd21cac0/Image-d7039b84.gz.xz

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

loop3: detected capacity change from 0 to 64
================================================================================
UBSAN: shift-out-of-bounds in fs/minix/inode.c:380:57
shift exponent 22784 is too large for 64-bit type 'unsigned long'
CPU: 1 PID: 7100 Comm: syz.3.519 Not tainted 6.1.116-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__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+0x2f4/0x36c lib/ubsan.c:321
minix_statfs+0x2f0/0x2f4 fs/minix/inode.c:380
statfs_by_dentry fs/statfs.c:66 [inline]
vfs_get_fsid+0x17c/0x268 fs/statfs.c:77
fanotify_test_fsid+0xa4/0x2e4 fs/notify/fanotify/fanotify_user.c:1516
do_fanotify_mark+0x6a8/0xb64 fs/notify/fanotify/fanotify_user.c:1763
__do_sys_fanotify_mark fs/notify/fanotify/fanotify_user.c:1840 [inline]
__se_sys_fanotify_mark fs/notify/fanotify/fanotify_user.c:1836 [inline]
__arm64_sys_fanotify_mark+0xb8/0xd4 fs/notify/fanotify/fanotify_user.c:1836
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585
================================================================================
================================================================================
UBSAN: shift-out-of-bounds in fs/minix/bitmap.c:103:3
shift exponent 22784 is too large for 32-bit type '__u32' (aka 'unsigned int')
CPU: 0 PID: 7100 Comm: syz.3.519 Not tainted 6.1.116-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__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+0x2f4/0x36c lib/ubsan.c:321
minix_count_free_blocks+0x228/0x22c fs/minix/bitmap.c:103
minix_statfs+0x19c/0x2f4 fs/minix/inode.c:381
statfs_by_dentry fs/statfs.c:66 [inline]
vfs_get_fsid+0x17c/0x268 fs/statfs.c:77
fanotify_test_fsid+0xa4/0x2e4 fs/notify/fanotify/fanotify_user.c:1516
do_fanotify_mark+0x6a8/0xb64 fs/notify/fanotify/fanotify_user.c:1763
__do_sys_fanotify_mark fs/notify/fanotify/fanotify_user.c:1840 [inline]
__se_sys_fanotify_mark fs/notify/fanotify/fanotify_user.c:1836 [inline]
__arm64_sys_fanotify_mark+0xb8/0xd4 fs/notify/fanotify/fanotify_user.c:1836
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585
================================================================================


---
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,
Nov 9, 2024, 7:36:26 AM11/9/24
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: d7039b844a1c Linux 6.1.116
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=147610c0580000
kernel config: https://syzkaller.appspot.com/x/.config?x=e70423a11a31a773
dashboard link: https://syzkaller.appspot.com/bug?extid=e8422ab0c2a90434ef95
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=17737d87980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=127610c0580000
mounted in repro: https://storage.googleapis.com/syzbot-assets/201341a07606/mount_0.gz

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

option from the mount to silence this warning.
=======================================================
================================================================================
UBSAN: shift-out-of-bounds in fs/minix/inode.c:380:57
shift exponent 22784 is too large for 64-bit type 'unsigned long'
CPU: 1 PID: 4289 Comm: syz-executor237 Not tainted 6.1.116-syzkaller #0
CPU: 1 PID: 4289 Comm: syz-executor237 Not tainted 6.1.116-syzkaller #0
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.
Reply all
Reply to author
Forward
0 new messages