# CVE-2025-40063: crypto: comp - Use same definition of context alloc and free ops

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.0
- **CVSS:** 7.0 (v3.1, CNA) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.19% (percentile 5, 2026-11-26)
- **Published:** 2025-10-28T11:48:34.549Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= 42d9f6c774790d290c175e8775ce9f1366438098, \< 779d3b6f2d32c5f1da6163e959abe1e1ffe2945b; \>= 42d9f6c774790d290c175e8775ce9f1366438098, \< f75f66683ded09f7135aef2e763c245a07c8271a
- Anyone running Linux 6.16

## 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.

## Affected and fixed versions

- Linux: \>= 42d9f6c774790d290c175e8775ce9f1366438098, \< 779d3b6f2d32c5f1da6163e959abe1e1ffe2945b; \>= 42d9f6c774790d290c175e8775ce9f1366438098, \< f75f66683ded09f7135aef2e763c245a07c8271a (cvelist)
- Linux: 6.16 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-40063. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-40063.md
Affected: Linux >= 42d9f6c774790d290c175e8775ce9f1366438098, < 779d3b6f2d32c5f1da6163e959abe1e1ffe2945b; >= 42d9f6c774790d290c175e8775ce9f1366438098, < f75f66683ded09f7135aef2e763c245a07c8271a; Linux 6.16
Fixed in: Linux 779d3b6f2d32c5f1da6163e959abe1e1ffe2945b

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-40063 being exploited?

There is no confirmed exploitation: CVE-2025-40063 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.19% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-40063?

High: CVSS 7.0 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2025-40063?

Linux \>= 42d9f6c774790d290c175e8775ce9f1366438098, \< 779d3b6f2d32c5f1da6163e959abe1e1ffe2945b; \>= 42d9f6c774790d290c175e8775ce9f1366438098, \< f75f66683ded09f7135aef2e763c245a07c8271a; Linux 6.16.

### Is there a fix for CVE-2025-40063?

Yes. Fixed in Linux 779d3b6f2d32c5f1da6163e959abe1e1ffe2945b. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2025-40063?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/779d3b6f2d32c5f1da6163e959abe1e1ffe2945b>
- other: <https://git.kernel.org/stable/c/f75f66683ded09f7135aef2e763c245a07c8271a>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-40063>

HTML: <https://flawdb.com/CVE-2025-40063> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-40063>
