squashfs: Add dictionary size range check to prevent shift-out-of-bounds
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ ff750311d30acc9564ef577050794953eee59f01 · < 0cb85377daaefb4ce5ce72975f2deb27ee0e0cad| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
squashfs: Add dictionary size range check to prevent shift-out-of-bounds
When an abnormal SquashFS image (COMP_OPTS flag is 1 but dictionary size is 0) is mounted, and performs shift operations using dictionarysize, the shift exponent is -1, causing a shift-out-of-bounds.
Detail as below: squashfs_comp_opts(msblk, buffer, length) squashfs_xz_comp_opts() if (comp_opts) n = ffs(opts->dict_size) - 1;<----opts->dict_size=0, n=-1 if (opts->dict_size != (1 << n) && opts->dict_size != (1 << n) + (1 << (n + 1))) <----shift-out-of-bounds
Fix it by adding a dictionary size range check before the shift operation.
From the CVE record · Linux
The Linux kernel’s SquashFS code can perform an out-of-bounds shift when mounting an abnormal SquashFS image whose COMP_OPTS flag is set and dictionary size is zero. The input does not specify whether an attacker needs authentication or user interaction.
Engineers running the Linux kernel with SquashFS support should check their versions; affected versions are not specified.