# CVE-2025-21778: tracing: Do not allow mmap() of persistent ring buffer

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; 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.30% (percentile 16, 2026-11-26)
- **Published:** 2025-02-27T02:18:22.506Z
- **Modified:** 2026-08-05T11:54:21.703Z

## Who should check

- Anyone running Linux \>= 9b7bdf6f6ece6ea888cc7d2f02c00b403b66a119, \< e8dff5f73912513fc9b52ab992d861517c9a9975; \>= 9b7bdf6f6ece6ea888cc7d2f02c00b403b66a119, \< cf5aa560e5c7628b57c928741d7e6a9a0f6f0e67; \>= 9b7bdf6f6ece6ea888cc7d2f02c00b403b66a119, \< 129fe718819cc5e24ea2f489db9ccd4371f0c6f6
- Anyone running Linux 6.12

## Description

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

tracing: Do not allow mmap() of persistent ring buffer

When trying to mmap a trace instance buffer that is attached to
reserve\_mem, it would crash:

 BUG: unable to handle page fault for address: ffffe97bd00025c8
 \#PF: supervisor read access in kernel mode
 \#PF: error\_code(0x0000) - not-present page
 PGD 2862f3067 P4D 2862f3067 PUD 0
 Oops: Oops: 0000 \[\#1\] PREEMPT\_RT SMP PTI
 CPU: 4 UID: 0 PID: 981 Comm: mmap-rb Not tainted 6.14.0-rc2-test-00003-g7f1a5e3fbf9e-dirty \#233
 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
 RIP: 0010:validate\_page\_before\_insert+0x5/0xb0
 Code: e2 01 89 d0 c3 cc cc cc cc 66 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 \<48\> 8b 46 08 a8 01 75 67 66 90 48 89 f0 8b 50 34 85 d2 74 76 48 89
 RSP: 0018:ffffb148c2f3f968 EFLAGS: 00010246
 RAX: ffff9fa5d3322000 RBX: ffff9fa5ccff9c08 RCX: 00000000b879ed29
 RDX: ffffe97bd00025c0 RSI: ffffe97bd00025c0 RDI: ffff9fa5ccff9c08
 RBP: ffffb148c2f3f9f0 R08: 0000000000000004 R09: 0000000000000004
 R10: 0000000000000000 R11: 0000000000000200 R12: 0000000000000000
 R13: 00007f16a18d5000 R14: ffff9fa5c48db6a8 R15: 0000000000000000
 FS:  00007f16a1b54740(0000) GS:ffff9fa73df00000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: ffffe97bd00025c8 CR3: 00000001048c6006 CR4: 0000000000172ef0
 Call Trace:
  \<TASK\>
  ? \_\_die\_body.cold+0x19/0x1f
  ? \_\_die+0x2e/0x40
  ? page\_fault\_oops+0x157/0x2b0
  ? search\_module\_extables+0x53/0x80
  ? validate\_page\_before\_insert+0x5/0xb0
  ? kernelmode\_fixup\_or\_oops.isra.0+0x5f/0x70
  ? \_\_bad\_area\_nosemaphore+0x16e/0x1b0
  ? bad\_area\_nosemaphore+0x16/0x20
  ? do\_kern\_addr\_fault+0x77/0x90
  ? exc\_page\_fault+0x22b/0x230
  ? asm\_exc\_page\_fault+0x2b/0x30
  ? validate\_page\_before\_insert+0x5/0xb0
  ? vm\_insert\_pages+0x151/0x400
  \_\_rb\_map\_vma+0x21f/0x3f0
  ring\_buffer\_map+0x21b/0x2f0
  tracing\_buffers\_mmap+0x70/0xd0
  \_\_mmap\_region+0x6f0/0xbd0
  mmap\_region+0x7f/0x130
  do\_mmap+0x475/0x610
  vm\_mmap\_pgoff+0xf2/0x1d0
  ksys\_mmap\_pgoff+0x166/0x200
  \_\_x64\_sys\_mmap+0x37/0x50
  x64\_sys\_call+0x1670/0x1d70
  do\_syscall\_64+0xbb/0x1d0
  entry\_SYSCALL\_64\_after\_hwframe+0x77/0x7f

The reason was that the code that maps the ring buffer pages to user space
has:

	page = virt\_to\_page((void \*)cpu\_buffer-\>subbuf\_ids\[s\]);

And uses that in:

	vm\_insert\_pages(vma, vma-\>vm\_start, pages, &nr\_pages);

But virt\_to\_page() does not work with vmap()'d memory which is what the
persistent ring buffer has. It is rather trivial to allow this, but for
now just disable mmap() of instances that have their ring buffer from the
reserve\_mem option.

If an mmap() is performed on a persistent buffer it will return -ENODEV
just like it would if the .mmap field wasn't defined in the
file\_operations structure.

## Affected and fixed versions

- Linux: \>= 9b7bdf6f6ece6ea888cc7d2f02c00b403b66a119, \< e8dff5f73912513fc9b52ab992d861517c9a9975; \>= 9b7bdf6f6ece6ea888cc7d2f02c00b403b66a119, \< cf5aa560e5c7628b57c928741d7e6a9a0f6f0e67; \>= 9b7bdf6f6ece6ea888cc7d2f02c00b403b66a119, \< 129fe718819cc5e24ea2f489db9ccd4371f0c6f6 (cvelist)
- Linux: 6.12 (cvelist)

## Mitigation

- Upgrade Linux to 129fe718819cc5e24ea2f489db9ccd4371f0c6f6 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-21778.md
Affected: Linux >= 9b7bdf6f6ece6ea888cc7d2f02c00b403b66a119, < e8dff5f73912513fc9b52ab992d861517c9a9975; >= 9b7bdf6f6ece6ea888cc7d2f02c00b403b66a119, < cf5aa560e5c7628b57c928741d7e6a9a0f6f0e67; >= 9b7bdf6f6ece6ea888cc7d2f02c00b403b66a119, < 129fe718819cc5e24ea2f489db9ccd4371f0c6f6; Linux 6.12
Fixed in: Linux 129fe718819cc5e24ea2f489db9ccd4371f0c6f6

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-21778 being exploited?

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

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

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= 9b7bdf6f6ece6ea888cc7d2f02c00b403b66a119, \< e8dff5f73912513fc9b52ab992d861517c9a9975; \>= 9b7bdf6f6ece6ea888cc7d2f02c00b403b66a119, \< cf5aa560e5c7628b57c928741d7e6a9a0f6f0e67; \>= 9b7bdf6f6ece6ea888cc7d2f02c00b403b66a119, \< 129fe718819cc5e24ea2f489db9ccd4371f0c6f6; Linux 6.12.

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

Yes. Fixed in Linux 129fe718819cc5e24ea2f489db9ccd4371f0c6f6. Upgrade Linux to 129fe718819cc5e24ea2f489db9ccd4371f0c6f6 or later.

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

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

- patch: <https://git.kernel.org/stable/c/e8dff5f73912513fc9b52ab992d861517c9a9975>
- patch: <https://git.kernel.org/stable/c/cf5aa560e5c7628b57c928741d7e6a9a0f6f0e67>
- patch: <https://git.kernel.org/stable/c/129fe718819cc5e24ea2f489db9ccd4371f0c6f6>

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

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