syzbot
UBSAN: shift-out-of-bounds in squashfs_xz_comp_opts
Status:
upstream: reported C repro on 2026/02/17 19:48
Subsystems:
squashfs
Labels:
prio:high
[Documentation on labels]
Reported-by: syzbot+99fc070a2affcd27784b@syzkaller.appspotmail.com
Fix commit:
Squashfs: check xz dictionary size isn't zero
Patched on: [ci-upstream-linux-next-kasan-gce-root ci-upstream-rust-kasan-gce], missing on: [ci-qemu-gce-upstream-auto ci-qemu-native-arm64-kvm ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 157d, last: 118d
Sample crash report:
loop3: detected capacity change from 0 to 8
------------[ cut here ]------------
UBSAN: shift-out-of-bounds in fs/squashfs/xz_wrapper.c:62:29
shift exponent -1 is negative
CPU: 1 UID: 0 PID: 6061 Comm: syz.3.20 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Call Trace:
<TASK>
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
ubsan_epilogue+0xa/0x30 lib/ubsan.c:233
__ubsan_handle_shift_out_of_bounds+0x385/0x410 lib/ubsan.c:494
squashfs_xz_comp_opts+0x259/0x300 fs/squashfs/xz_wrapper.c:62
squashfs_comp_opts fs/squashfs/decompressor.h:31 [inline]
get_comp_opts fs/squashfs/decompressor.c:119 [inline]
squashfs_decompressor_setup+0x123/0x2c0 fs/squashfs/decompressor.c:131
squashfs_fill_super+0x10a4/0x22c0 fs/squashfs/super.c:353
get_tree_bdev_flags+0x431/0x4f0 fs/super.c:1694
vfs_get_tree+0x92/0x2a0 fs/super.c:1754
fc_mount fs/namespace.c:1193 [inline]
do_new_mount_fc fs/namespace.c:3760 [inline]
do_new_mount+0x341/0xd30 fs/namespace.c:3836
do_mount fs/namespace.c:4159 [inline]
__do_sys_mount fs/namespace.c:4348 [inline]
__se_sys_mount+0x31d/0x420 fs/namespace.c:4325
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f3a0dbdd20a
Code: 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff c3 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffef042a358 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffef042a3e0 RCX: 00007f3a0dbdd20a
RDX: 00002000000002c0 RSI: 0000200000000580 RDI: 00007ffef042a3a0
RBP: 00002000000002c0 R08: 00007ffef042a3e0 R09: 0000000000000005
R10: 0000000000000005 R11: 0000000000000246 R12: 0000200000000580
R13: 00007ffef042a3a0 R14: 0000000000000199 R15: 0000200000000000
</TASK>
---[ end trace ]---
* Struck through repros no longer work on HEAD.