CVE-2024-40971 f2fs: remove clear SB_INLINECRYPT flag in default_options

High 7.3 Published Updated

A race condition in f2fs remounting can cause new files to miss inline encryption, potentially leading to data corruption when wrapped keys are enabled.

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-2024-40971?

CVE-2024-40971 is a high-severity vulnerability in Linux kernel, published on 12 Jul 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:

f2fs: remove clear SB_INLINECRYPT flag in default_options

In f2fs_remount, SB_INLINECRYPT flag will be clear and re-set. If create new file or open file during this gap, these files will not use inlinecrypt. Worse case, it may lead to data corruption if wrappedkey_v0 is enable.

Thread A: Thread B:

-f2fs_remount -f2fs_file_open or f2fs_new_inode -default_options <- clear SB_INLINECRYPT flag

-fscrypt_select_encryption_impl

-parse_options <- set SB_INLINECRYPT again

Which versions are affected by CVE-2024-40971?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-40971?

Apply the vendor's patch.

Is CVE-2024-40971 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-40971, DEBIAN-CVE-2024-40971, GHSA-9fjc-5v5w-9j3p, UBUNTU-CVE-2024-40971.

Is CVE-2024-40971 in your software?

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

Check your SBOMs for free