CVE-2025-22035 json
tracing: Fix use-after-free in print_graph_function_flags during tracer switching
published 2025-04-16 18 mo ago modified 2026-08-05 3 mo ago also EUVD-2025-11251
- cvss
- 7.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.3%
- EPSS 0.3% chance of exploitation in 30 days, percentile 22%
- public exploits
- 0
- none known
Summary
In the Linux kernel, the following vulnerability has been resolved:
tracing: Fix use-after-free in print_graph_function_flags during tracer switching
Kairui reported a UAF issue in print_graph_function_flags() during ftrace stress testing [1]. This issue can be reproduced if puting a 'mdelay(10)' after 'mutex_unlock(&trace_types_lock)' in s_start(), and executing the following script:
$ echo function_graph > current_tracer $ cat trace > /dev/null & $ sleep 5 # Ensure the 'cat' reaches the 'mdelay(10)' point $ echo timerlat > current_tracer
The root cause lies in the two calls to print_graph_function_flags within print_trace_line during each s_show():
* One through 'iter->trace->print_line()'; * Another through 'event->funcs->trace()', which is hidden in print_trace_fmt() before print_trace_line returns.
Tracer switching only updates the former, while the latter continues to use the print_line function of the old tracer, which in the script above is print_graph_function_flags.
Moreover, when switching from the 'function_graph' tracer to the 'timerlat' tracer, s_start only calls graph_trace_close of the 'function_graph' tracer to free 'iter->private', but does not set it to NULL. This provides an opportunity for 'event->funcs->trace()' to use an invalid 'iter->private'.
To fix this issue, set 'iter->private' to NULL immediately after freeing it in graph_trace_close(), ensuring that an invalid pointer is not passed to other tracers. Additionally, clean up the unnecessary 'iter->private = NULL' during each 'cat trace' when using wakeup and irqsoff tracers.
[1] https://lore.kernel.org/all/20231112150030.84609-1-ryncsn@gmail.com/
Patch / fix
- Linux Linux 4.15, 4.20, 5.4.292, 5.10.236, 5.15.180, 6.1.134, 6.5, 6.6.87, 6.12.23, 6.13.11, 6.14.2, 6.15
- linux Debian 12 6.1.135-1
- linux Debian 14, Debian 13 6.12.25-1
debian advisories DEBIAN-CVE-2025-22035
- linux Ubuntu 22.04 LTS 5.15.0-142.152
- linux Ubuntu 24.04 LTS 6.8.0-86.87
- linux-aws Ubuntu 22.04 LTS 5.15.0-1086.93
- linux-aws Ubuntu 24.04 LTS 6.8.0-1041.43
- linux-gcp Ubuntu 22.04 LTS 5.15.0-1085.94
- linux-gcp Ubuntu 24.04 LTS 6.8.0-1042.45
- linux-gke Ubuntu 22.04 LTS 5.15.0-1083.89
- linux-gke Ubuntu 24.04 LTS 6.8.0-1038.43
ubuntu advisories UBUNTU-CVE-2025-22035
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kernel-coco SLE Module for Confidential Computing Technical Preview 15 SP6 6.4.0-15061.28.coco15sp6.1
- kernel-syms-coco SLE Module for Confidential Computing Technical Preview 15 SP6 6.4.0-15061.28.coco15sp6.1
- kernel-coco_debug SLE Module for Confidential Computing Technical Preview 15 SP6 6.4.0-15061.28.coco15sp6.1
- kernel-source-coco SLE Module for Confidential Computing Technical Preview 15 SP6 6.4.0-15061.28.coco15sp6.1
- dtb-aarch64 openSUSE Leap 15.6 6.4.0-150600.23.60.3
- kernel-64kb SLE Module for Basesystem 15 SP6, openSUSE Leap 15.6 6.4.0-150600.23.60.4
- kernel-syms SLE Module for Development Tools 15 SP6, openSUSE Leap 15.6 6.4.0-150600.23.60.4
- kernel-obs-qa openSUSE Leap 15.6 6.4.0-150600.23.60.2
suse advisories SUSE-SU-2025:02923-1SUSE-SU-2025:02538-1SUSE-SU-2025:20498-1SUSE-SU-2025:20483-1SUSE-SU-2025:02335-1SUSE-SU-2025:02334-1
- git.kernel.org/stable/c/42561fe62c3628ea3bc9623f64f047605e98857f commit
- git.kernel.org/stable/c/de7b309139f862a44379ecd96e93c9133c69f813 commit
- git.kernel.org/stable/c/81a85b12132c8ffe98f5ddbdc185481790aeaa1b commit
- git.kernel.org/stable/c/a2cce54c1748216535dda02e185d07a084be837e commit
- git.kernel.org/stable/c/099ef3385800828b74933a96c117574637c3fb3a commit
- git.kernel.org/stable/c/c85efe6e13743cac6ba4ccf144cb91f44c86231a commit
- git.kernel.org/stable/c/f14752d66056d0c7bffe5092130409417d3baa70 commit
- git.kernel.org/stable/c/70be951bc01e4a0e10d443f3510bb17426f257fb commit
- git.kernel.org/stable/c/7f81f27b1093e4895e87b74143c59c055c3b1906 commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2025-22035 updated cvss 6.7
kernel: tracing: Fix use-after-free in print_graph_function_flags during tracer switching
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 moreaffected: no fix planned “Out of support scope”
-
Red Hat Enterprise Linux 10 kernelaffected: no fix available “Fix deferred”
-
Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 18 mo ago
Exploit prediction
0.30% chance of exploitation in the next 30 days, higher than 22% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| CISA ADP | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected products
- Linux Linux
Classification
- Weakness
-
- CWE-416 Use After Free
- Technology feeds
References
-
git.kernel.org
/stable/c/42561fe62c3628ea3bc9623f64f047605e98857f
patch
-
git.kernel.org
/stable/c/de7b309139f862a44379ecd96e93c9133c69f813
patch
-
git.kernel.org
/stable/c/81a85b12132c8ffe98f5ddbdc185481790aeaa1b
patch
-
git.kernel.org
/stable/c/a2cce54c1748216535dda02e185d07a084be837e
patch
-
git.kernel.org
/stable/c/099ef3385800828b74933a96c117574637c3fb3a
patch
-
git.kernel.org
/stable/c/c85efe6e13743cac6ba4ccf144cb91f44c86231a
patch
-
git.kernel.org
/stable/c/f14752d66056d0c7bffe5092130409417d3baa70
patch
-
git.kernel.org
/stable/c/70be951bc01e4a0e10d443f3510bb17426f257fb
patch
-
git.kernel.org
/stable/c/7f81f27b1093e4895e87b74143c59c055c3b1906
patch
- lists.debian.org /debian-lts-announce/2025/05/msg00045.html
- lists.debian.org /debian-lts-announce/2025/05/msg00030.html
Sources
- CVE List CVE-2025-22035
- NVD CVE-2025-22035
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.