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
1Patches
73a21698ace91d382d6daf01854506c6335698703940bd30b316b090c2feefbe96bd25423d0ca0df179c4Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- cert-portal.siemens.com/productcert/html/ssa-082556.htmlnvd
- git.kernel.org/stable/c/316b090c2fee964c307a634fecc7df269664b158nvd
- git.kernel.org/stable/c/3a21698ace915a445bce2d0dcfc84b6d2199baf7nvd
- git.kernel.org/stable/c/54506c6335690f4ef1b9f154e34f5a604c72c1ednvd
- git.kernel.org/stable/c/8703940bd30b5ad94408d28d7192db2491cd3592nvd
- git.kernel.org/stable/c/d0ca0df179c4b21e2a6c4a4fb637aa8fa14575cbnvd
- git.kernel.org/stable/c/d382d6daf0184490f366562469a5673f65ee2662nvd
- git.kernel.org/stable/c/fbe96bd25423e61273d8831e995260b429d850b6nvd
News mentions
0No linked articles in our index yet.