VYPR
Unrated severityNVD Advisory· Published Oct 24, 2025· Updated May 12, 2026

CVE-2025-40022

CVE-2025-40022

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.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

In the Linux kernel's crypto/af_alg, a boolean type mismatch (bool changed to u32 bitfield) causes incorrect 'more' and 'merge' values, potentially leading to logic errors; fix restores bool type.

In the Linux kernel's crypto subsystem, the af_alg interface had a vulnerability where fields more and merge were changed from bool to 1-bit u32 bitfields in commit 1b34cbbf4f01. However, assignments to these fields used values that relied on C's implicit conversion to boolean, which results in truncation to modulo 2 when assigned to a 1-bit bitfield. This led to incorrect boolean values, where 0 could be stored when 1 was intended [1][4].

The af_alg interface is used for cryptographic operations via sockets. A local attacker with access to a socket can manipulate sendmsg calls to trigger the faulty logic. The bug specifically affects the more and merge fields which control the handling of data fragments. The incorrect boolean values can cause the kernel to incorrectly merge data or mis-handle the end of a message, potentially bypassing concurrency protection or leading to inconsistent state [2][3].

The impact could range from data corruption to security bypass of concurrency controls introduced in the original commit. While no public exploit exists, the vulnerability allows a local user to potentially cause denial of service or gain elevated privileges due to kernel memory corruption [1]. The Siemens advisory lists SIMATIC S7-1500 CPU family as affected products, indicating industrial systems are at risk [1].

Patches have been released in the Linux kernel stable branches, reverting the fields back to bool type [2][3][4]. Users should apply the relevant patch for their kernel version. Siemens has released a security advisory with product-specific remediations [1].

AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

1

Patches

7

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

8

News mentions

0

No linked articles in our index yet.