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

High 7.0 Published Updated

A Linux kernel memory corruption vulnerability in the crypto subsystem allows attackers to potentially execute arbitrary code or escalate privileges due to struct layout mismatches.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-40063?

CVE-2025-40063 is a high-severity memory corruption vulnerability in Linux, published on 28 Oct 2025. It can only be exploited from the same machine or local network, with no action from the victim.

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

Which versions are affected by CVE-2025-40063?

How do I fix CVE-2025-40063?

Apply the vendor's patch.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2025-40063 being exploited?

There is no known exploitation of CVE-2025-40063 in the wild and no public exploit code.

Sources

Also known as BELL-CVE-2025-40063, DEBIAN-CVE-2025-40063, GHSA-94hr-47ff-rmcx, UBUNTU-CVE-2025-40063.

Is CVE-2025-40063 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free