[Android 6.1] UBSAN: shift-out-of-bounds in exfat_fill_super

4 views
Skip to first unread message

syzbot

unread,
Apr 16, 2025, 10:18:27 AMApr 16
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: efda22f3484c ANDROID: GKI: update symbol list for xiaomi
git tree: android14-6.1
console+strace: https://syzkaller.appspot.com/x/log.txt?x=11cd88cc580000
kernel config: https://syzkaller.appspot.com/x/.config?x=82e71fa000d4b060
dashboard link: https://syzkaller.appspot.com/bug?extid=619a09223476d86149f7
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11bd8204580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12d86fe4580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/45fb6f318eae/disk-efda22f3.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/1777106bf339/vmlinux-efda22f3.xz
kernel image: https://storage.googleapis.com/syzbot-assets/2cf49227823a/bzImage-efda22f3.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/fc238772fba6/mount_0.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=16bd8204580000)

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

loop0: detected capacity change from 0 to 256
exFAT-fs (loop0): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
exFAT-fs (loop0): Medium has reported failures. Some data may be lost.
================================================================================
UBSAN: shift-out-of-bounds in fs/exfat/super.c:529:38
shift exponent 185 is too large for 32-bit type 'int'
CPU: 0 PID: 434 Comm: syz-executor268 Not tainted 6.1.129-syzkaller-00006-gefda22f3484c #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
dump_stack+0x15/0x18 lib/dump_stack.c:113
ubsan_epilogue lib/ubsan.c:151 [inline]
__ubsan_handle_shift_out_of_bounds+0x3e1/0x440 lib/ubsan.c:321
exfat_read_boot_sector fs/exfat/super.c:529 [inline]
__exfat_fill_super fs/exfat/super.c:585 [inline]
exfat_fill_super+0x2b3a/0x2b80 fs/exfat/super.c:649
get_tree_bdev+0x440/0x680 fs/super.c:1368
exfat_get_tree+0x1c/0x20 fs/exfat/super.c:721
vfs_get_tree+0x88/0x290 fs/super.c:1575
do_new_mount+0x2ba/0xb30 fs/namespace.c:3056
path_mount+0x671/0x1070 fs/namespace.c:3386
do_mount fs/namespace.c:3399 [inline]
__do_sys_mount fs/namespace.c:3607 [inline]
__se_sys_mount+0x2c4/0x3b0 fs/namespace.c:3584
__x64_sys_mount+0xbf/0xd0 fs/namespace.c:3584
x64_sys_call+0x49d/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:166
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fa7fb0dcfea
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 5e 04 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fa7fb098088 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fa7fb0980a0 RCX: 00007fa7fb0dcfea
RDX: 0000200000000000 RSI: 0000200000000240 RDI: 00007fa7fb0980a0
RBP: 0000200000000240 R08: 00007fa7fb0980e0 R09: 00000000000014f8
R10: 0000000000000000 R11: 0000000000000286 R12: 0000200000000000
R13: 00007fa7fb0980e0 R14: 0000000000000003 R15: 0000000000000000
</TASK>
================================================================================
exFAT-fs (loop0): unable to set blocksize 33554432
exFAT-fs (loop0): failed to read boot sector
exFAT-fs (loop0): failed to recognize exfat type


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

Junjie Cao

unread,
Nov 13, 2025, 2:03:28 AMNov 13
to syzbot+619a09...@syzkaller.appspotmail.com, syzkaller-a...@googlegroups.com, syzkall...@googlegroups.com
#syz test: https://github.com/Junjie650/linux.git exfat-ubsan-guard

Hi,

Please test the exfat UBSAN fix on the above tree/branch.

Thanks,
Junjie

syzbot

unread,
Nov 13, 2025, 2:57:03 AMNov 13
to junji...@intel.com, syzkaller-a...@googlegroups.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
UBSAN: shift-out-of-bounds in exfat_fill_super

loop2: detected capacity change from 0 to 256
exFAT-fs (loop2): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
exFAT-fs (loop2): Medium has reported failures. Some data may be lost.
------------[ cut here ]------------
UBSAN: shift-out-of-bounds in fs/exfat/super.c:539:39
shift exponent 185 is too large for 32-bit type 'unsigned int'
CPU: 0 UID: 0 PID: 488 Comm: syz.2.18 Not tainted syzkaller #0 PREEMPT
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
<TASK>
__dump_stack+0x21/0x30 lib/dump_stack.c:94
dump_stack_lvl+0x107/0x180 lib/dump_stack.c:120
dump_stack+0x15/0x1c lib/dump_stack.c:129
ubsan_epilogue+0xe/0x40 lib/ubsan.c:233
__ubsan_handle_shift_out_of_bounds+0x382/0x420 lib/ubsan.c:494
exfat_read_boot_sector fs/exfat/super.c:539 [inline]
__exfat_fill_super fs/exfat/super.c:596 [inline]
exfat_fill_super+0x261e/0x2a00 fs/exfat/super.c:671
get_tree_bdev_flags+0x403/0x4c0 fs/super.c:1697
get_tree_bdev+0x1f/0x30 fs/super.c:1720
exfat_get_tree+0x1c/0x30 fs/exfat/super.c:734
vfs_get_tree+0x9d/0x290 fs/super.c:1757
fc_mount fs/namespace.c:1209 [inline]
do_new_mount_fc fs/namespace.c:3652 [inline]
do_new_mount+0x2fe/0xa00 fs/namespace.c:3728
path_mount+0x671/0xfc0 fs/namespace.c:4038
do_mount fs/namespace.c:4051 [inline]
__do_sys_mount fs/namespace.c:4240 [inline]
__se_sys_mount+0x363/0x3e0 fs/namespace.c:4217
__x64_sys_mount+0xbf/0xf0 fs/namespace.c:4217
x64_sys_call+0x2c8e/0x3000 arch/x86/include/generated/asm/syscalls_64.h:166
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x5e/0xdb0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7f04d4d90e6a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f04d5ce1e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f04d5ce1ef0 RCX: 00007f04d4d90e6a
RDX: 0000200000000000 RSI: 0000200000000240 RDI: 00007f04d5ce1eb0
RBP: 0000200000000000 R08: 00007f04d5ce1ef0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000000240
R13: 00007f04d5ce1eb0 R14: 00000000000014fe R15: 0000200000000600
</TASK>
---[ end trace ]---
exfat: block size(33554432) > page size(4096) not supported by filesystem
exFAT-fs (loop2): unable to set blocksize 33554432
exFAT-fs (loop2): failed to read boot sector
exFAT-fs (loop2): failed to recognize exfat type


Tested on:

commit: 1a289a6b exfat: use unsigned base for boot sector bit ..
git tree: https://github.com/Junjie650/linux.git exfat-ubsan-guard
console output: https://syzkaller.appspot.com/x/log.txt?x=1426f0b4580000
kernel config: https://syzkaller.appspot.com/x/.config?x=4f6206809e7d7aa3
dashboard link: https://syzkaller.appspot.com/bug?extid=619a09223476d86149f7
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8

Note: no patches were applied.
Reply all
Reply to author
Forward
0 new messages