CVE-2023-52933 Squashfs: fix handling and sanity checking of xattr_ids count

Medium 5.5 Published Updated

Integer overflow in Squashfs xattr handling allows attackers to bypass sanity checks, potentially causing denial of service.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2023-52933?

CVE-2023-52933 is a medium-severity vulnerability in Linux kernel, published on 27 Mar 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

In the Linux kernel, the following vulnerability has been resolved:

Squashfs: fix handling and sanity checking of xattr_ids count

A Sysbot [1] corrupted filesystem exposes two flaws in the handling and sanity checking of the xattr_ids count in the filesystem. Both of these flaws cause computation overflow due to incorrect typing.

In the corrupted filesystem the xattr_ids value is 4294967071, which stored in a signed variable becomes the negative number -225.

Flaw 1 (64-bit systems only):

The signed integer xattr_ids variable causes sign extension.

This causes variable overflow in the SQUASHFS_XATTR_*(A) macros. The variable is first multiplied by sizeof(struct squashfs_xattr_id) where the type of the sizeof operator is "unsigned long".

On a 64-bit system this is 64-bits in size, and causes the negative number to be sign extended and widened to 64-bits and then become unsigned. This produces the very large number 18446744073709548016 or 2^64 - 3600. This number when rounded up by SQUASHFS_METADATA_SIZE - 1 (8191 bytes) and divided by SQUASHFS_METADATA_SIZE overflows and produces a length of 0 (stored in len).

Flaw 2 (32-bit systems only):

On a 32-bit system the integer variable is not widened by the unsigned long type of the sizeof operator (32-bits), and the signedness of the variable has no effect due it always being treated as unsigned.

The above corrupted xattr_ids value of 4294967071, when multiplied overflows and produces the number 4294963696 or 2^32 - 3400. This number when rounded up by SQUASHFS_METADATA_SIZE - 1 (8191 bytes) and divided by SQUASHFS_METADATA_SIZE overflows again and produces a length of 0.

The effect of the 0 length computation:

In conjunction with the corrupted xattr_ids field, the filesystem also has a corrupted xattr_table_start value, where it matches the end of filesystem value of 850.

This causes the following sanity check code to fail because the incorrectly computed len of 0 matches the incorrect size of the table reported by the superblock (0 bytes).

len = SQUASHFS_XATTR_BLOCK_BYTES(*xattr_ids); indexes = SQUASHFS_XATTR_BLOCKS(*xattr_ids);

/* * The computed size of the index table (len bytes) should exactly * match the table start and end points */ start = table_start + sizeof(*id_table); end = msblk->bytes_used;

if (len != (end - start)) return ERR_PTR(-EINVAL);

Changing the xattr_ids variable to be "usigned int" fixes the flaw on a 64-bit system. This relies on the fact the computation is widened by the unsigned long type of the sizeof operator.

Casting the variable to u64 in the above macro fixes this flaw on a 32-bit system.

It also means 64-bit systems do not implicitly rely on the type of the sizeof operator to widen the computation.

[1] https://lore.kernel.org/lkml/[email protected]/

Weakness: CWE-190

Which versions are affected by CVE-2023-52933?

It affects 1 product.

Linux distribution packages (40)
kernel AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-64k AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-64k-core AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-64k-debug AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-64k-debug-core AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-64k-debug-devel AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-64k-debug-devel-matched AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-64k-debug-modules AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-64k-debug-modules-core AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-64k-debug-modules-extra AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-64k-devel AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-64k-devel-matched AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-64k-modules AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-64k-modules-core AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-64k-modules-extra AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-abi-stablelists AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-core AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-cross-headers AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-debug AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-debug-core AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-debug-devel AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-debug-devel-matched AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-debug-modules AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-debug-modules-core AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-debug-modules-extra AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-debug-uki-virt AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-devel AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-devel-matched AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-doc AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-headers AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-modules AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-modules-core AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-modules-extra AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-rt AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-rt-64k AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-rt-64k-core AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-rt-64k-debug AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-rt-64k-debug-core AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-rt-64k-debug-devel AlmaLinux:9All versions5.14.0-570.24.1.el9_6
kernel-rt-64k-debug-modules AlmaLinux:9All versions5.14.0-570.24.1.el9_6

Products include Linux kernel.

How do I fix CVE-2023-52933?

Apply the vendor's patch.

Is CVE-2023-52933 being exploited?

There is no known exploitation of CVE-2023-52933 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as ALSA-2025:9880, BELL-CVE-2023-52933, DEBIAN-CVE-2023-52933, GHSA-f76f-mm36-mf6v, RHSA-2025:9880, UBUNTU-CVE-2023-52933.

Is CVE-2023-52933 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free