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

- Severity: High 7.0 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.13%, higher than 3% of CVEs (2026-12-01)
- Published: 2025-10-28T11:48:34.549Z
- Modified: 2026-10-19T21:10:00.160Z
- Assigned by: Linux

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

(As written by CVE List.)

## Affected

- Linux Linux: from 42d9f6c774790d290c175e8775ce9f1366438098 before 779d3b6f2d32c5f1da6163e959abe1e1ffe2945b; from 42d9f6c774790d290c175e8775ce9f1366438098 before f75f66683ded09f7135aef2e763c245a07c8271a; 6.16 (not affected: before 6.16; from 6.17.3 up to 6.17.*; from 6.18 up to *)

## References

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

## Sources

- CVE List: [CVE-2025-40063](https://www.cve.org/CVERecord?id=CVE-2025-40063), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2025-40063](https://nvd.nist.gov/vuln/detail/CVE-2025-40063), Public domain, modified 2026-10-19

---

Page: https://cve.day/CVE-2025-40063 · Whole record: https://cve.day/CVE-2025-40063.json · Rebuilt by cve.day 2026-11-25T22:59:06.940Z
