CVE-2021-47113 btrfs: abort in rename_exchange if we fail to insert the second ref

High 7.1 Published Updated

A use-after-free in the Linux kernel btrfs filesystem can cause corruption and denial of service during failed rename operations.

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-2021-47113?

CVE-2021-47113 is a high-severity use after free vulnerability in Linux kernel, published on 15 Mar 2024. 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:

btrfs: abort in rename_exchange if we fail to insert the second ref

Error injection stress uncovered a problem where we'd leave a dangling inode ref if we failed during a rename_exchange. This happens because we insert the inode ref for one side of the rename, and then for the other side. If this second inode ref insert fails we'll leave the first one dangling and leave a corrupt file system behind. Fix this by aborting if we did the insert for the first inode ref.

Weakness: CWE-416

Which versions are affected by CVE-2021-47113?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2021-47113?

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-2021-47113 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-47113, GHSA-g4rp-89x9-87mq, UBUNTU-CVE-2021-47113.

Is CVE-2021-47113 in your software?

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

Check your SBOMs for free