{"uuid": "886c15f1-1553-4b4c-9845-c8c0f1647d58", "vulnerability_lookup_origin": "1a89b78e-f703-45f3-bb86-59eb712668bd", "author": "2a075640-a300-48a4-bb44-bc6130783b9b", "vulnerability": "CVE-2025-22035", "type": "published-proof-of-concept", "source": "https://t.me/DarkWebInformer_CVEAlerts/14809", "content": "\ud83d\udd17 DarkWebInformer.com - Cyber Threat Intelligence\n\ud83d\udccc CVE ID: CVE-2025-22035\n\ud83d\udd25 CVSS Score: N/A\n\ud83d\udd39 Description: In the Linux kernel, the following vulnerability has been resolved:\n\ntracing: Fix use-after-free in print_graph_function_flags during tracer switching\n\nKairui reported a UAF issue in print_graph_function_flags() during\nftrace stress testing [1]. This issue can be reproduced if puting a\n'mdelay(10)' after 'mutex_unlock(&amp;trace_types_lock)' in s_start(),\nand executing the following script:\n\n  $ echo function_graph &gt; current_tracer\n  $ cat trace &gt; /dev/null &amp;\n  $ sleep 5  # Ensure the 'cat' reaches the 'mdelay(10)' point\n  $ echo timerlat &gt; current_tracer\n\nThe root cause lies in the two calls to print_graph_function_flags\nwithin print_trace_line during each s_show():\n\n  * One through 'iter-&gt;trace-&gt;print_line()';\n  * Another through 'event-&gt;funcs-&gt;trace()', which is hidden in\n    print_trace_fmt() before print_trace_line returns.\n\nTracer switching only updates the former, while the latter continues\nto use the print_line function of the old tracer, which in the script\nabove is print_graph_function_flags.\n\nMoreover, when switching from the 'function_graph' tracer to the\n'timerlat' tracer, s_start only calls graph_trace_close of the\n'function_graph' tracer to free 'iter-&gt;private', but does not set\nit to NULL. This provides an opportunity for 'event-&gt;funcs-&gt;trace()'\nto use an invalid 'iter-&gt;private'.\n\nTo fix this issue, set 'iter-&gt;private' to NULL immediately after\nfreeing it in graph_trace_close(), ensuring that an invalid pointer\nis not passed to other tracers. Additionally, clean up the unnecessary\n'iter-&gt;private = NULL' during each 'cat trace' when using wakeup and\nirqsoff tracers.\n\n [1] https://lore.kernel.org/all/20231112150030.84609-1-ryncsn@gmail.com/\n\ud83d\udccf Published: 2025-04-16T14:11:53.958Z\n\ud83d\udccf Modified: 2025-05-04T13:06:54.739Z\n\ud83d\udd17 References:\n1. https://git.kernel.org/stable/c/42561fe62c3628ea3bc9623f64f047605e98857f\n2. https://git.kernel.org/stable/c/de7b309139f862a44379ecd96e93c9133c69f813\n3. https://git.kernel.org/stable/c/81a85b12132c8ffe98f5ddbdc185481790aeaa1b\n4. https://git.kernel.org/stable/c/a2cce54c1748216535dda02e185d07a084be837e\n5. https://git.kernel.org/stable/c/099ef3385800828b74933a96c117574637c3fb3a\n6. https://git.kernel.org/stable/c/c85efe6e13743cac6ba4ccf144cb91f44c86231a\n7. https://git.kernel.org/stable/c/f14752d66056d0c7bffe5092130409417d3baa70\n8. https://git.kernel.org/stable/c/70be951bc01e4a0e10d443f3510bb17426f257fb\n9. https://git.kernel.org/stable/c/7f81f27b1093e4895e87b74143c59c055c3b1906", "creation_timestamp": "2025-05-04T13:18:54.000000Z"}