CVE-2025-40022 crypto: af_alg - Fix incorrect boolean values in af_alg_ctx

Not scored Published Updated

Incorrect boolean handling in Linux kernel crypto module may cause logic errors, requiring local access to exploit.

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-2025-40022?

CVE-2025-40022 is a vulnerability in Linux, published on 24 Oct 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:

crypto: af_alg - Fix incorrect boolean values in af_alg_ctx

Commit 1b34cbbf4f01 ("crypto: af_alg - Disallow concurrent writes in af_alg_sendmsg") changed some fields from bool to 1-bit bitfields of type u32.

However, some assignments to these fields, specifically 'more' and 'merge', assign values greater than 1. These relied on C's implicit conversion to bool, such that zero becomes false and nonzero becomes true.

With a 1-bit bitfields of type u32 instead, mod 2 of the value is taken instead, resulting in 0 being assigned in some cases when 1 was intended.

Fix this by restoring the bool type.

Which versions are affected by CVE-2025-40022?

How do I fix CVE-2025-40022?

Apply the vendor's patch.

Is CVE-2025-40022 being exploited?

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

Sources

Also known as BELL-CVE-2025-40022, DEBIAN-CVE-2025-40022, GHSA-rjhr-rr92-fh8c, ROOT-OS-DEBIAN-11-CVE-2025-40022, ROOT-OS-DEBIAN-12-CVE-2025-40022, ROOT-OS-DEBIAN-13-CVE-2025-40022 and 1 more.

Is CVE-2025-40022 in your software?

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

Check your SBOMs for free