VDB

CVE-2025-22035

CVE-2025-22035 PUBLISHED CVSS 7.8 HIGH

tracing: Fix use-after-free in print_graph_function_flags during tracer switching

Reported by linux · Published April 16, 2025

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/

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
perfAmazon Linux6.1.134-150.224.amzn2023
kernel-headersAmazon Linux6.1.134-150.224.amzn2023
kernel-livepatch-6.1.134-150.224Amazon Linux1.0-0.amzn2023
python3-perfAmazon Linux6.1.134-150.224.amzn2023
kernel6.12-modules-extraAmazon Linux6.12.23-29.97.amzn2023
perf6.12Amazon Linux6.12.23-29.97.amzn2023
kernel-modules-extra-commonAmazon Linux6.1.134-150.224.amzn2023
linux_kernellinux6.14.2, 6.13.11, 6.12.23, 6.6.87, 6.1.134, 5.15.180, 5.10.236, 5.4.292, 4.20, 4.15
LinuxLinuxa2cce54c1748216535dda02e185d07a084be837e, 7f81f27b1093e4895e87b74143c59c055c3b1906, 6.5, 5.15.180, 42561fe62c3628ea3bc9623f64f047605e98857f, 4.20, 4.15

Risk scores

CVSS 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

VendorProductVersions
LinuxLinux05319d707732c728eb721ac616a50e7978eb499a, b8205dfed68183dc1470e83863c5ded6d7fa30a9, ce6e2b14bc094866d9173db6935da2d752f06d8b
LinuxLinux6.5, 0, 5.4.292
amazon:2023perf0
amazon:2023kernel-headers0
amazon:2023kernel-livepatch-6.1.134-150.2240
amazon:2023python3-perf0
amazon:2023kernel6.12-modules-extra0
amazon:2023perf6.120
amazon:2023kernel-modules-extra-common0
LinuxLinux6.4.13, 0, 5.4.292
amazon:2023python3-perf6.120
amazon:2023kernel-libbpf-devel0
amazon:2023kernel-devel0
amazon:2023kernel-livepatch-6.12.23-29.970
amazon:2023kernel6.120
amazon:2023kernel-libbpf0
linuxlinux_kernel6.1.50, 4.19.293, 5.10.193
amazon:2023kernel-tools0
amazon:2023kernel-libbpf-static0
amazon:2023bpftool0

…and 3 more

Timeline

  • Apr 16, 2025 CVE Published
  • Apr 17, 2025 EPSS Score (30 in total, the first dated here)
  • Apr 25, 2025 Coalition ESS Score (19 in total, the first dated here)
  • Oct 12, 2025 PoC Published (5 in total, the first dated here)
  • Dec 21, 2025 Security Advisory (328 in total, the first dated here)
  • Apr 20, 2026 Distribution Patch (321 in total, the first dated here)

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2025-22035
vulnetix vdb fixes CVE-2025-22035

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2025-22035/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›