Squashfs: check return result of sb_min_blocksize
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 0aa666190509ffab81c202c5095a166be23961ac · < 0aff95d9bc7fb5400ca8af507429c4b067bdb425| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
Squashfs: check return result of sb_min_blocksize
Syzkaller reports an "UBSAN: shift-out-of-bounds in squashfs_bio_read" bug.
Syzkaller forks multiple processes which after mounting the Squashfs filesystem, issues an ioctl("/dev/loop0", LOOP_SET_BLOCK_SIZE, 0x8000). Now if this ioctl occurs at the same time another process is in the process of mounting a Squashfs filesystem on /dev/loop0, the failure occurs. When this happens the following code in squashfs_fill_super() fails.
---- msblk->devblksize = sb_min_blocksize(sb, SQUASHFS_DEVBLK_SIZE); msblk->devblksize_log2 = ffz(~msblk->devblksize); ----
sb_min_blocksize() returns 0, which means msblk->devblksize is set to 0.
As a result, ffz(~msblk->devblksize) returns 64, and msblk->devblksize_log2 is set to 64.
This subsequently causes the
From the CVE record · Linux
The Linux kernel’s Squashfs mount code fails to check whether sb_min_blocksize() returns zero. A local process can trigger an out-of-bounds shift if a loop-device block-size change occurs while another process mounts a Squashfs filesystem on that device. The report does not specify authentication requirements beyond the ability to perform those operations.
Engineers running Linux kernels with Squashfs support should check their kernel; affected versions are not specified.