{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-39689","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2025-04-16T07:20:57.113Z","datePublished":"2025-09-05T17:20:55.270Z","dateUpdated":"2026-08-05T12:04:34.544Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-08-05T12:04:34.544Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nftrace: Also allocate and copy hash for reading of filter files\n\nCurrently the reader of set_ftrace_filter and set_ftrace_notrace just adds\nthe pointer to the global tracer hash to its iterator. Unlike the writer\nthat allocates a copy of the hash, the reader keeps the pointer to the\nfilter hashes. This is problematic because this pointer is static across\nfunction calls that release the locks that can update the global tracer\nhashes. This can cause UAF and similar bugs.\n\nAllocate and copy the hash for reading the filter files like it is done\nfor the writers. This not only fixes UAF bugs, but also makes the code a\nbit simpler as it doesn't have to differentiate when to free the\niterator's hash between writers and readers."}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The vulnerability is reached only by opening and reading the tracefs files set_ftrace_filter/set_ftrace_notrace and concurrently writing to them, which requires local access to the mounted tracefs instance. There is no network-facing path into ftrace_regex_open().\nAC:L - The attacker drives both sides of the race entirely from userspace — a partial read() on a read-only fd leaves the stale hash pointer in the iterator, a write on a second fd frees it, and the attacker can then sleep arbitrarily long to guarantee the RCU grace period elapses and to spray the freed slab object before reading again. No condition lies outside the attacker's control.\nPR:L - No capability is checked anywhere on the path (only the non-default LOCKDOWN_TRACEFS hook); access is decided by tracefs file permissions, which are routinely granted to a non-root group — Android's atrace.rc gives the shell user 0660 root:shell on set_ftrace_filter, and the tracefs gid= mount option is used for the same purpose on ChromeOS and embedded/CI systems. An ordinary local account in that tracing group can perform both the read and the write needed.\nUI:N - A single unprivileged process (or two threads) performs the entire sequence of open/read/write/read on its own. No victim action or cooperation is required.\nS:U - The freed ftrace_hash and its buckets array live in the kernel heap and the impact stays within the kernel's own security authority. No VM, IOMMU, or sandbox boundary is crossed.\nC:H - After the hash is freed and reallocated, ftrace_lookup_ip() reads an attacker-controlled size_bits and buckets pointer and chases hlist entries, yielding an arbitrary kernel-memory read primitive plus a per-record oracle leaking whether attacker-chosen addresses hold matching values.\nI:H - The dangling ftrace_hash can be reclaimed and shaped via heap spraying, and the related seq_open()-failure path frees the live global filter hash outright, leaving ops->func_hash->filter_hash dangling for later add_hash_entry()/ftrace_hash_clear() operations and for the function-tracer hot path — giving controlled writes into a reallocated object and a route to control-flow hijack.\nA:H - Dereferencing the freed ftrace_hash (reading ->count, ->size_bits and indexing ->buckets) reliably faults or corrupts the slab, producing a kernel oops or panic. The reporters observed exactly such UAF crashes with KASAN."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/trace/ftrace.c"],"versions":[{"version":"c20489dad156dd9919ebd854bbace46dbd2576a3","lessThan":"12064e1880fc9202be75ff668205b1703d92f74f","status":"affected","versionType":"git"},{"version":"c20489dad156dd9919ebd854bbace46dbd2576a3","lessThan":"c4cd93811e038d19f961985735ef7bb128078dfb","status":"affected","versionType":"git"},{"version":"c20489dad156dd9919ebd854bbace46dbd2576a3","lessThan":"e0b6b223167e1edde5c82edf38e393c06eda1f13","status":"affected","versionType":"git"},{"version":"c20489dad156dd9919ebd854bbace46dbd2576a3","lessThan":"a40c69f4f1ed96acbcd62e9b5ff3a596f0a91309","status":"affected","versionType":"git"},{"version":"c20489dad156dd9919ebd854bbace46dbd2576a3","lessThan":"3b114a3282ab1a12cb4618a8f45db5d7185e784a","status":"affected","versionType":"git"},{"version":"c20489dad156dd9919ebd854bbace46dbd2576a3","lessThan":"c591ba1acd081d4980713e47869dd1cc3d963d19","status":"affected","versionType":"git"},{"version":"c20489dad156dd9919ebd854bbace46dbd2576a3","lessThan":"64db338140d2bad99a0a8c6a118dd60b3e1fb8cb","status":"affected","versionType":"git"},{"version":"c20489dad156dd9919ebd854bbace46dbd2576a3","lessThan":"bfb336cf97df7b37b2b2edec0f69773e06d11955","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/trace/ftrace.c"],"versions":[{"version":"4.12","status":"affected"},{"version":"0","lessThan":"4.12","status":"unaffected","versionType":"semver"},{"version":"5.4.297","lessThanOrEqual":"5.4.*","status":"unaffected","versionType":"semver"},{"version":"5.10.241","lessThanOrEqual":"5.10.*","status":"unaffected","versionType":"semver"},{"version":"5.15.190","lessThanOrEqual":"5.15.*","status":"unaffected","versionType":"semver"},{"version":"6.1.149","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.6.103","lessThanOrEqual":"6.6.*","status":"unaffected","versionType":"semver"},{"version":"6.12.44","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.16.4","lessThanOrEqual":"6.16.*","status":"unaffected","versionType":"semver"},{"version":"6.17","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.12","versionEndExcluding":"5.4.297"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.12","versionEndExcluding":"5.10.241"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.12","versionEndExcluding":"5.15.190"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.12","versionEndExcluding":"6.1.149"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.12","versionEndExcluding":"6.6.103"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.12","versionEndExcluding":"6.12.44"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.12","versionEndExcluding":"6.16.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.12","versionEndExcluding":"6.17"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/12064e1880fc9202be75ff668205b1703d92f74f"},{"url":"https://git.kernel.org/stable/c/c4cd93811e038d19f961985735ef7bb128078dfb"},{"url":"https://git.kernel.org/stable/c/e0b6b223167e1edde5c82edf38e393c06eda1f13"},{"url":"https://git.kernel.org/stable/c/a40c69f4f1ed96acbcd62e9b5ff3a596f0a91309"},{"url":"https://git.kernel.org/stable/c/3b114a3282ab1a12cb4618a8f45db5d7185e784a"},{"url":"https://git.kernel.org/stable/c/c591ba1acd081d4980713e47869dd1cc3d963d19"},{"url":"https://git.kernel.org/stable/c/64db338140d2bad99a0a8c6a118dd60b3e1fb8cb"},{"url":"https://git.kernel.org/stable/c/bfb336cf97df7b37b2b2edec0f69773e06d11955"}],"title":"ftrace: Also allocate and copy hash for reading of filter files","x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html"},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html"}],"providerMetadata":{"orgId":"af854a3a-2127-422b-91ae-364da2661108","shortName":"CVE","dateUpdated":"2025-11-03T17:42:22.147Z"}},{"x_adpType":"supplier","providerMetadata":{"orgId":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","shortName":"siemens-SADP","dateUpdated":"2026-07-14T12:42:38.117Z"},"affected":[{"vendor":"Siemens","product":"SIMATIC CN 4100","versions":[{"status":"affected","version":"0","lessThan":"V5.0","versionType":"custom"}],"defaultStatus":"unknown"},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","versions":[{"status":"affected","version":"V3.1.5","lessThan":"*","versionType":"custom"}],"defaultStatus":"unknown"},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","versions":[{"status":"affected","version":"V3.1.5","lessThan":"*","versionType":"custom"}],"defaultStatus":"unknown"},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","versions":[{"status":"affected","version":"V3.1.5","lessThan":"*","versionType":"custom"}],"defaultStatus":"unknown"},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","versions":[{"status":"affected","version":"V3.1.5","lessThan":"*","versionType":"custom"}],"defaultStatus":"unknown"},{"vendor":"Siemens","product":"SIPLUS S7-1500 CPU 1518-4 PN/DP MFP","versions":[{"status":"affected","version":"V3.1.5","lessThan":"*","versionType":"custom"}],"defaultStatus":"unknown"}],"references":[{"url":"https://cert-portal.siemens.com/productcert/html/ssa-082556.html"},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-032379.html"}]}]}}