{"id":"CVE-2025-39813","aliases":["CVE-2025-39813"],"related":[],"kind":"vulnerability","state":"published","title":"ftrace: Fix potential warning in trace_printk_seq during ftrace_dump","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nftrace: Fix potential warning in trace_printk_seq during ftrace_dump\n\nWhen calling ftrace_dump_one() concurrently with reading trace_pipe,\na WARN_ON_ONCE() in trace_printk_seq() can be triggered due to a race\ncondition.\n\nThe issue occurs because:\n\nCPU0 (ftrace_dump)                              CPU1 (reader)\necho z > /proc/sysrq-trigger\n\n!trace_empty(&iter)\ntrace_iterator_reset(&iter) <- len = size = 0\n                                                cat /sys/kernel/tracing/trace_pipe\ntrace_find_next_entry_inc(&iter)\n  __find_next_entry\n    ring_buffer_empty_cpu <- all empty\n  return NULL\n\ntrace_printk_seq(&iter.seq)\n  WARN_ON_ONCE(s->seq.len >= s->seq.size)\n\nIn the context between trace_empty() and trace_find_next_entry_inc()\nduring ftrace_dump, the ring buffer data was consumed by other readers.\nThis caused trace_find_next_entry_inc to return NULL, failing to populate\n`iter.seq`. At this point, due to the prior trace_iterator_reset, both\n`iter.seq.len` and `iter.seq.size` were set to 0. Since they are equal,\nthe WARN_ON_ONCE condition is triggered.\n\nMove the trace_printk_seq() into the if block that checks to make sure the\nreturn value of trace_find_next_entry_inc() is non-NULL in\nftrace_dump_one(), ensuring the 'iter.seq' is properly populated before\nsubsequent operations.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nftrace: Fix potential warning in trace_printk_seq during ftrace_dump\n\nWhen calling ftrace_dump_one() concurrently with reading trace_pipe,\na WARN_ON_ONCE() in trace_printk_seq() can be triggered due to a race\ncondition.\n\nThe issue occurs because:\n\nCPU0 (ftrace_dump)                              CPU1 (reader)\necho z > /proc/sysrq-trigger\n\n!trace_empty(&iter)\ntrace_iterator_reset(&iter) <- len = size = 0\n                                                cat /sys/kernel/tracing/trace_pipe\ntrace_find_next_entry_inc(&iter)\n  __find_next_entry\n    ring_buffer_empty_cpu <- all empty\n  return NULL\n\ntrace_printk_seq(&iter.seq)\n  WARN_ON_ONCE(s->seq.len >= s->seq.size)\n\nIn the context between trace_empty() and trace_find_next_entry_inc()\nduring ftrace_dump, the ring buffer data was consumed by other readers.\nThis caused trace_find_next_entry_inc to return NULL, failing to populate\n`iter.seq`. At this point, due to the prior trace_iterator_reset, both\n`iter.seq.len` and `iter.seq.size` were set to 0. Since they are equal,\nthe WARN_ON_ONCE condition is triggered.\n\nMove the trace_printk_seq() into the if block that checks to make sure the\nreturn value of trace_find_next_entry_inc() is non-NULL in\nftrace_dump_one(), ensuring the 'iter.seq' is properly populated before\nsubsequent operations.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nftrace: Soluciona una advertencia potencial en trace_printk_seq durante ftrace_dump\n\nAl llamar a ftrace_dump_one() concurrentemente con la lectura de trace_pipe, una WARN_ON_ONCE() en trace_printk_seq() puede ser activada debido a una condición de carrera.\n\nEl problema ocurre porque:\n\nCPU0 (ftrace_dump)                              CPU1 (lector)\necho z > /proc/sysrq-trigger\n\n!trace_empty(&iter)\ntrace_iterator_reset(&iter) <- len = size = 0\n                                                cat /sys/kernel/tracing/trace_pipe\ntrace_find_next_entry_inc(&iter)\n  __find_next_entry\n    ring_buffer_empty_cpu <- todo vacío\n  return NULL\n\ntrace_printk_seq(&iter.seq)\n  WARN_ON_ONCE(s->seq.len >= s->seq.size)\n\nEn el contexto entre trace_empty() y trace_find_next_entry_inc() durante ftrace_dump, los datos del búfer circular fueron consumidos por otros lectores. Esto hizo que trace_find_next_entry_inc devolviera NULL, fallando en poblar 'iter.seq'. En este punto, debido al trace_iterator_reset previo, tanto 'iter.seq.len' como 'iter.seq.size' se establecieron en 0. Dado que son iguales, la condición WARN_ON_ONCE se activa.\n\nMover trace_printk_seq() al bloque 'if' que verifica que el valor de retorno de trace_find_next_entry_inc() no sea NULL en ftrace_dump_one(), asegurando que 'iter.seq' se pueble correctamente antes de operaciones posteriores.","source":"nvd"}],"published":"2025-09-16T13:00:14.846Z","modified":"2026-11-05T22:17:32.590Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","score":4.7,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","score":4.7,"rating":"MEDIUM"}],"cwes":["CWE-362"],"affected":[{"ranges":[{"type":"git","introduced":"d769041f865330034131525ee6a7f72eb4af2a24","fixed":"f299353e7ccbcc5c2ed8993c48fbe7609cbe729a","status":"affected"},{"type":"git","introduced":"d769041f865330034131525ee6a7f72eb4af2a24","fixed":"5ab0ec206deb99eb3baf8f1d7602aeaa91dbcc85","status":"affected"},{"type":"git","introduced":"d769041f865330034131525ee6a7f72eb4af2a24","fixed":"a6f0f8873cc30fd4543b09adf03f7f51d293f0e6","status":"affected"},{"type":"git","introduced":"d769041f865330034131525ee6a7f72eb4af2a24","fixed":"e80ff23ba8bdb0f41a1afe2657078e4097d13a9a","status":"affected"},{"type":"git","introduced":"d769041f865330034131525ee6a7f72eb4af2a24","fixed":"28c8fb7ae2ad27d81c8de3c4fe608c509f6a18aa","status":"affected"},{"type":"git","introduced":"d769041f865330034131525ee6a7f72eb4af2a24","fixed":"ced94e137e6cd5e79c65564841d3b7695d0f5fa3","status":"affected"},{"type":"git","introduced":"d769041f865330034131525ee6a7f72eb4af2a24","fixed":"fbd4cf7ee4db65ef36796769fe978e9eba6f0de4","status":"affected"},{"type":"git","introduced":"d769041f865330034131525ee6a7f72eb4af2a24","fixed":"4013aef2ced9b756a410f50d12df9ebe6a883e4a","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"2.6.28","status":"affected"},{"type":"semver","introduced":"0","fixed":"2.6.28","status":"unaffected"},{"type":"semver","introduced":"5.4.298","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.242","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.191","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.150","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.104","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.45","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.16.5","lastAffected":"6.16.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.17","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"2.6.28","fixed":"5.4.298"},{"status":"affected","introduced":"5.5","fixed":"5.10.242"},{"status":"affected","introduced":"5.11","fixed":"5.15.191"},{"status":"affected","introduced":"5.16","fixed":"6.1.150"},{"status":"affected","introduced":"6.2","fixed":"6.6.104"},{"status":"affected","introduced":"6.7","fixed":"6.12.45"},{"status":"affected","introduced":"6.13","fixed":"6.16.5"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"11.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/f299353e7ccbcc5c2ed8993c48fbe7609cbe729a","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5ab0ec206deb99eb3baf8f1d7602aeaa91dbcc85","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a6f0f8873cc30fd4543b09adf03f7f51d293f0e6","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e80ff23ba8bdb0f41a1afe2657078e4097d13a9a","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/28c8fb7ae2ad27d81c8de3c4fe608c509f6a18aa","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ced94e137e6cd5e79c65564841d3b7695d0f5fa3","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/fbd4cf7ee4db65ef36796769fe978e9eba6f0de4","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/4013aef2ced9b756a410f50d12df9ebe6a883e4a","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-032379.html","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-05T21:12:05.539Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-39813","url":"https://www.cve.org/CVERecord?id=CVE-2025-39813","licence":"CVE Terms of Use","modified":"2026-11-05T21:12:59.108Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-39813","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-39813","licence":"Public domain","modified":"2026-11-05T22:17:32.590Z"}],"updatedAt":"2026-11-25T22:59:04.724Z","epss":{"score":0.00126,"percentile":0.02498,"date":"2026-12-01T12:00:22.000Z"}}