# CVE-2025-68262: crypto: zstd - fix double-free in per-CPU stream cleanup

> A double-free vulnerability in the Linux kernel's zstd crypto module allows attackers to cause denial of service or potentially execute code.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Not stated
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 16 Dec 2025
- **Updated:** 11 May 2026
- **Also known as:** BELL-CVE-2025-68262, DEBIAN-CVE-2025-68262, GHSA-3792-937m-5pm4, UBUNTU-CVE-2025-68262

## What is CVE-2025-68262?

CVE-2025-68262 is an use after free vulnerability in Linux, published on 16 Dec 2025. 

### Official description

In the Linux kernel, the following vulnerability has been resolved:

crypto: zstd - fix double-free in per-CPU stream cleanup

The crypto/zstd module has a double-free bug that occurs when multiple
tfms are allocated and freed.

The issue happens because zstd_streams (per-CPU contexts) are freed in
zstd_exit() during every tfm destruction, rather than being managed at
the module level.  When multiple tfms exist, each tfm exit attempts to
free the same shared per-CPU streams, resulting in a double-free.

This leads to a stack trace similar to:

  BUG: Bad page state in process kworker/u16:1  pfn:106fd93
  page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106fd93
  flags: 0x17ffffc0000000(node=0|zone=2|lastcpupid=0x1fffff)
  page_type: 0xffffffff()
  raw: 0017ffffc0000000 dead000000000100 dead000000000122 0000000000000000
  raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
  page dumped because: nonzero entire_mapcount
  Modules linked in: ...
  CPU: 3 UID: 0 PID: 2506 Comm: kworker/u16:1 Kdump: loaded Tainted: G    B
  Hardware name: ...
  Workqueue: btrfs-delalloc btrfs_work_helper
  Call Trace:
   <TASK>
   dump_stack_lvl+0x5d/0x80
   bad_page+0x71/0xd0
   free_unref_page_prepare+0x24e/0x490
   free_unref_page+0x60/0x170
   crypto_acomp_free_streams+0x5d/0xc0
   crypto_acomp_exit_tfm+0x23/0x50
   crypto_destroy_tfm+0x60/0xc0
   ...

Change the lifecycle management of zstd_streams to free the streams only
once during module cleanup.

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


## How do I fix CVE-2025-68262?

Apply the vendor's patch.

## Is CVE-2025-68262 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-68262 and fix it if it is affected.

What it is: CVE-2025-68262 is an use after free vulnerability in Linux, published on 16 Dec 2025. 
Exploitation: There is no known exploitation of CVE-2025-68262 in the wild and no public exploit code.

Affected product: Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-68262/ (Markdown: https://insights.sbomify.com/CVE-2025-68262/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-68262
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-68262
- OSV: https://osv.dev/vulnerability/CVE-2025-68262

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-68262/
Summaries are generated and may contain mistakes; the official description above is the record.
