CVE-2023-54062 ext4: fix invalid free tracking in ext4_xattr_move_to_block()

High 7.8 Published Updated

A use-after-free vulnerability in the Linux kernel ext4 filesystem allows attackers to cause denial of service or potentially execute code via crafted extended attributes.

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

CVE-2023-54062 is a high-severity use after free vulnerability in Linux, published on 24 Dec 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:

ext4: fix invalid free tracking in ext4_xattr_move_to_block()

In ext4_xattr_move_to_block(), the value of the extended attribute which we need to move to an external block may be allocated by kvmalloc() if the value is stored in an external inode. So at the end of the function the code tried to check if this was the case by testing entry->e_value_inum.

However, at this point, the pointer to the xattr entry is no longer valid, because it was removed from the original location where it had been stored. So we could end up calling kvfree() on a pointer which was not allocated by kvmalloc(); or we could also potentially leak memory by not freeing the buffer when it should be freed. Fix this by storing whether it should be freed in a separate variable.

Which versions are affected by CVE-2023-54062?

How do I fix CVE-2023-54062?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2023-54062 being exploited?

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

Sources

Also known as BELL-CVE-2023-54062, DEBIAN-CVE-2023-54062, GHSA-3m76-cj86-mwp4, UBUNTU-CVE-2023-54062.

Is CVE-2023-54062 in your software?

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

Check your SBOMs for free