Linux hwe edge: In the Linux kernel, the following vulnerability has been resolved: crypto: comp - Use same definition of context alloc and free ops In commit… (CVE-2025-40063)
In the Linux kernel, the following vulnerability has been resolved: crypto: comp - Use same definition of context alloc and free ops In commit 42d9f6c77479 ("crypto: acomp - Move scomp stream allocation code into acomp"), the crypto_acomp_streams struct was made to rely on having the alloc_ctx and free_ctx operations defined in the same order as the scomp_alg struct. But in that same commit, the alloc_ctx and free_ctx members of scomp_alg may be randomized by structure layout randomization, since they are contained in a pure ops structure (containing only function pointers). If the pointers within scomp_alg are randomized, but those in crypto_acomp_streams are not, then the order may no longer match. This fixes the problem by removing the union from scomp_alg so that both crypto_acomp_streams and scomp_alg will share the same definition of alloc_ctx and free_ctx, ensuring they will always have the same layout.
AI Analysis
Technical Summary
The vulnerability (CVE-2025-40063) in the Linux kernel's crypto component related to compression (comp) was due to inconsistent definitions of alloc_ctx and free_ctx operations between the scomp_alg struct and the crypto_acomp_streams struct. A commit introduced structure layout randomization for scomp_alg, which could cause the order of function pointers to differ from that in crypto_acomp_streams, leading to potential misuse of these pointers. The resolution removed the union from scomp_alg so both structures share the same layout, ensuring alloc_ctx and free_ctx are consistently defined and ordered.
Potential Impact
If exploited, this vulnerability could lead to high impact on confidentiality, integrity, and availability of the system, as indicated by the CVSS vector (AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H). The misalignment of function pointers could cause incorrect cryptographic operations or memory corruption within the kernel's crypto compression functionality.
Mitigation Recommendations
A fix has been applied in the Linux kernel source code that removes the union from the scomp_alg structure to ensure consistent layout with crypto_acomp_streams. Users should update their Linux kernel to a version that includes this fix. No additional mitigations are specified.
Linux hwe edge: In the Linux kernel, the following vulnerability has been resolved: crypto: comp - Use same definition of context alloc and free ops In commit… (CVE-2025-40063)
Description
In the Linux kernel, the following vulnerability has been resolved: crypto: comp - Use same definition of context alloc and free ops In commit 42d9f6c77479 ("crypto: acomp - Move scomp stream allocation code into acomp"), the crypto_acomp_streams struct was made to rely on having the alloc_ctx and free_ctx operations defined in the same order as the scomp_alg struct. But in that same commit, the alloc_ctx and free_ctx members of scomp_alg may be randomized by structure layout randomization, since they are contained in a pure ops structure (containing only function pointers). If the pointers within scomp_alg are randomized, but those in crypto_acomp_streams are not, then the order may no longer match. This fixes the problem by removing the union from scomp_alg so that both crypto_acomp_streams and scomp_alg will share the same definition of alloc_ctx and free_ctx, ensuring they will always have the same layout.
CVSS v3.1
Score 7.0high
Affected software
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability (CVE-2025-40063) in the Linux kernel's crypto component related to compression (comp) was due to inconsistent definitions of alloc_ctx and free_ctx operations between the scomp_alg struct and the crypto_acomp_streams struct. A commit introduced structure layout randomization for scomp_alg, which could cause the order of function pointers to differ from that in crypto_acomp_streams, leading to potential misuse of these pointers. The resolution removed the union from scomp_alg so both structures share the same layout, ensuring alloc_ctx and free_ctx are consistently defined and ordered.
Potential Impact
If exploited, this vulnerability could lead to high impact on confidentiality, integrity, and availability of the system, as indicated by the CVSS vector (AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H). The misalignment of function pointers could cause incorrect cryptographic operations or memory corruption within the kernel's crypto compression functionality.
Mitigation Recommendations
A fix has been applied in the Linux kernel source code that removes the union from the scomp_alg structure to ensure consistent layout with crypto_acomp_streams. Users should update their Linux kernel to a version that includes this fix. No additional mitigations are specified.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-94hr-47ff-rmcx
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2025-40063"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a6b72d79c2644c7f847b1dc
Added to database: 07/30/2026, 15:50:47 UTC
Last enriched: 07/30/2026, 16:22:56 UTC
Last updated: 09/10/2026, 19:36:50 UTC
Views: 21
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.