CVE-2025-22035 tracing: Fix use-after-free in print_graph_function_flags during tracer switching
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: no · technical impact: total
- Technology
- Linux KernelUbuntuDebian
Description
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/
Upgrade path
11 packages: 11 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| azure linux kernel(Azure Linux 3.0) | < 6.6.92.2-1 | 6.6.92.2-1 | Fixed |
| cbl-mariner kernel(CBL-Mariner 2.0) | < 5.15.180.1-1 | 5.15.180.1-1 | Fixed |
| debian/linux(Debian 12) | < 6.1.135-1; = 6.1.27-1; = 6.1.37-1; = 6.1.38-1 +34 more | 6.1.135-1 | Fixed |
| debian/linux(Debian 13) | < 6.12.25-1 | 6.12.25-1 | Fixed |
| debian/linux(Debian 14) | < 6.12.25-1 | 6.12.25-1 | Fixed |
| Linux kernel | < 5.4.292; < 5.10.236; < 5.15.180; < 6.1.134 +29 more | 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, 7f81f27b1093e4895e87b74143c59c055c3b1906, 70be951bc01e4a0e10d443f3510bb17426f257fb, 81a85b12132c8ffe98f5ddbdc185481790aeaa1b, 099ef3385800828b74933a96c117574637c3fb3a, 42561fe62c3628ea3bc9623f64f047605e98857f, a2cce54c1748216535dda02e185d07a084be837e, c85efe6e13743cac6ba4ccf144cb91f44c86231a, de7b309139f862a44379ecd96e93c9133c69f813, f14752d66056d0c7bffe5092130409417d3baa70 | Fixed |
| ubuntu/linux(Ubuntu 22.04) | < 5.15.0-142.152 | 5.15.0-142.152 | Fixed |
| ubuntu/linux(Ubuntu 24.04) | < 6.8.0-86.87 | 6.8.0-86.87 | Fixed |
| ubuntu/linux-kvm(Ubuntu 22.04) | < 5.15.0-1082.87 | 5.15.0-1082.87 | Fixed |
| ubuntu/linux-raspi(Ubuntu 22.04) | < 5.15.0-1080.83 | 5.15.0-1080.83 | Fixed |
| ubuntu/linux-raspi(Ubuntu 24.04) | < 6.8.0-1041.45 | 6.8.0-1041.45 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| cbl-mariner kernel(CBL-Mariner:2.0) | < 5.15.180.1-1 | 5.15.180.1-1 |
| azure linux kernel(Azure Linux:3.0) | < 6.6.92.2-1 | 6.6.92.2-1 |
| debian/linux(Debian:12) | < 6.1.135-1 | 6.1.135-1 |
| debian/linux(Debian:12) | = 6.1.106-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.106-2 | No fix listed |
| debian/linux(Debian:12) | = 6.1.106-3 | No fix listed |
| debian/linux(Debian:12) | = 6.1.112-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.115-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.119-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.123-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.124-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.128-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.129-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.133-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.27-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.37-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-2 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-2~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-3 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-4 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-4~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.52-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.55-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.55-1~bpo11+1 | No fix listed |
Show 55 more
| Product | Affected versions | Fixed in |
|---|---|---|
| debian/linux(Debian:12) | = 6.1.64-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.66-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.67-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.69-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.69-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.76-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.76-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.82-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.85-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.90-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.90-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.94-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.94-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.98-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.99-1 | No fix listed |
| debian/linux(Debian:13) | < 6.12.25-1 | 6.12.25-1 |
| debian/linux(Debian:14) | < 6.12.25-1 | 6.12.25-1 |
| Linux kernel | >= 05319d707732c728eb721ac616a50e7978eb499a, < 42561fe62c3628ea3bc9623f64f047605e98857f | 42561fe62c3628ea3bc9623f64f047605e98857f |
| Linux kernel | >= b8205dfed68183dc1470e83863c5ded6d7fa30a9, < de7b309139f862a44379ecd96e93c9133c69f813 | de7b309139f862a44379ecd96e93c9133c69f813 |
| Linux kernel | >= ce6e2b14bc094866d9173db6935da2d752f06d8b, < 81a85b12132c8ffe98f5ddbdc185481790aeaa1b | 81a85b12132c8ffe98f5ddbdc185481790aeaa1b |
| Linux kernel | >= 2cb0c037c927db4ec928cc927488e52aa359786e, < a2cce54c1748216535dda02e185d07a084be837e | a2cce54c1748216535dda02e185d07a084be837e |
| Linux kernel | >= eecb91b9f98d6427d4af5fdb8f108f52572a39e7, < 099ef3385800828b74933a96c117574637c3fb3a | 099ef3385800828b74933a96c117574637c3fb3a |
| Linux kernel | >= eecb91b9f98d6427d4af5fdb8f108f52572a39e7, < c85efe6e13743cac6ba4ccf144cb91f44c86231a | c85efe6e13743cac6ba4ccf144cb91f44c86231a |
| Linux kernel | >= eecb91b9f98d6427d4af5fdb8f108f52572a39e7, < f14752d66056d0c7bffe5092130409417d3baa70 | f14752d66056d0c7bffe5092130409417d3baa70 |
| Linux kernel | >= eecb91b9f98d6427d4af5fdb8f108f52572a39e7, < 70be951bc01e4a0e10d443f3510bb17426f257fb | 70be951bc01e4a0e10d443f3510bb17426f257fb |
| Linux kernel | >= eecb91b9f98d6427d4af5fdb8f108f52572a39e7, < 7f81f27b1093e4895e87b74143c59c055c3b1906 | 7f81f27b1093e4895e87b74143c59c055c3b1906 |
| Linux kernel | = d6b35c9a8d51032ed9890431da3ae39fe76c1ae3 | No fix listed |
| Linux kernel | = 5d433eda76b66ab271f5924b26ddfec063eeb454 | No fix listed |
| Linux kernel | = 2242640e9bd94e706acf75c60a2ab1d0e150e0fb | No fix listed |
| Linux kernel | >= 5.4.255, < 5.4.292 | 5.4.292 |
| Linux kernel | >= 5.10.193, < 5.10.236 | 5.10.236 |
| Linux kernel | >= 5.15.129, < 5.15.180 | 5.15.180 |
| Linux kernel | >= 6.1.50, < 6.1.134 | 6.1.134 |
| Linux kernel | >= 4.14.324, < 4.15 | 4.15 |
| Linux kernel | >= 4.19.293, < 4.20 | 4.20 |
| Linux kernel | >= 6.4.13, < 6.5 | 6.5 |
| Linux kernel | = 6.5 | No fix listed |
| Linux kernel | < 5.4.292 | 5.4.292 |
| Linux kernel | < 5.10.236 | 5.10.236 |
| Linux kernel | < 5.15.180 | 5.15.180 |
| Linux kernel | < 6.1.134 | 6.1.134 |
| Linux kernel | < 6.6.87 | 6.6.87 |
| Linux kernel | < 6.12.23 | 6.12.23 |
| Linux kernel | < 6.13.11 | 6.13.11 |
| Linux kernel | < 6.14.2 | 6.14.2 |
| Linux kernel | < 6.15 | 6.15 |
| ubuntu/linux(Ubuntu:22.04) | < 5.15.0-142.152 | 5.15.0-142.152 |
| ubuntu/linux-kvm(Ubuntu:22.04) | < 5.15.0-1082.87 | 5.15.0-1082.87 |
| ubuntu/linux-raspi(Ubuntu:22.04) | < 5.15.0-1080.83 | 5.15.0-1080.83 |
| ubuntu/linux(Ubuntu:24.04) | < 6.8.0-86.87 | 6.8.0-86.87 |
| ubuntu/linux-raspi(Ubuntu:24.04) | < 6.8.0-1041.45 | 6.8.0-1041.45 |
| Linux kernel | >= 6.4.13, < 6.6.87 | 6.6.87 |
| Linux kernel | >= 6.7, < 6.12.23 | 6.12.23 |
| Linux kernel | >= 6.13, < 6.13.11 | 6.13.11 |
| Linux kernel | >= 6.14, < 6.14.2 | 6.14.2 |
References
- MSRC Security Update Guide vendor-advisory
- CBL-Mariner Releases vendor-advisory
- Debian Security Tracker CVE-2025-22035 vendor-advisory
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- lists.debian.org
- lists.debian.org
- Ubuntu CVE tracker vendor-advisory
- USN-7585-1 vendor-advisory
- USN-7585-2 vendor-advisory
- USN-7591-1 vendor-advisory
- USN-7591-2 vendor-advisory
- USN-7591-3 vendor-advisory
- USN-7592-1 vendor-advisory
- USN-7593-1 vendor-advisory
- USN-7594-1 vendor-advisory
- USN-7591-4 vendor-advisory
- USN-7597-1 vendor-advisory
- USN-7597-2 vendor-advisory
- USN-7598-1 vendor-advisory
- USN-7585-3 vendor-advisory
- USN-7585-4 vendor-advisory
- USN-7594-2 vendor-advisory
- USN-7602-1 vendor-advisory
- USN-7585-5 vendor-advisory
- USN-7605-1 vendor-advisory
- USN-7606-1 vendor-advisory
- USN-7585-6 vendor-advisory
- USN-7591-5 vendor-advisory
- USN-7605-2 vendor-advisory
- USN-7594-3 vendor-advisory
- USN-7628-1 vendor-advisory
- USN-7585-7 vendor-advisory
- USN-7640-1 vendor-advisory
- USN-7591-6 vendor-advisory
- USN-7655-1 vendor-advisory
- USN-7835-1 vendor-advisory
- USN-7835-2 vendor-advisory
- USN-7835-3 vendor-advisory
- USN-7835-4 vendor-advisory
- USN-7835-5 vendor-advisory
- USN-7835-6 vendor-advisory
- USN-7887-1 vendor-advisory
- USN-7887-2 vendor-advisory
- USN-7940-1 vendor-advisory
- USN-7940-2 vendor-advisory
- www.cve.org
- ENISA EUVD EUVD-2025-11251 third-party-advisory