{"id":"CVE-2026-99141","summary":"tracing: Fix crash in print_graph_function_event()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\ntracing: Fix crash in print_graph_function_event()\n\ntracing_set_tracer() assigns the flags of the newly selected tracer\nwith:\n\n\ttr-\u003ecurrent_trace_flags = t-\u003eflags ? : t-\u003etracer-\u003eflags;\n\nIf the new tracer defines neither static flags nor default flags, like\nhwlat, irqsoff or wakeup, add_tracer() has no per instance flags copy\nfor it, and both operands are NULL, so tr-\u003ecurrent_trace_flags ends up\nbeing NULL as well.\n\nThe ring buffer is not cleared when switching tracers: it is reset\ninside tracer_init(), after current_trace_flags was already assigned.\nIf the buffer still holds function_graph entries of the previous\ntracer, printing one of them dereferences the NULL pointer. This was\nhit by cat trace during an ftrace stress test:\n\n  BUG: kernel NULL pointer dereference, address: 0000000000000000\n  #PF: supervisor read access in kernel mode\n  RIP: 0010:print_graph_function_event+0xe/0x20\n  Call Trace:\n   s_show+0x4d/0x110\n   seq_read_iter+0x2d4/0x490\n   seq_read+0x130/0x170\n   vfs_read+0xb5/0x370\n   ksys_read+0x6d/0xe0\n   do_syscall_64+0xbc/0x450\n\nThe snapshot buffer is not reset at all, so this can be reproduced\nwithout a race:\n\n  echo function_graph \u003e /sys/kernel/tracing/current_tracer\n  echo 1 \u003e /sys/kernel/tracing/snapshot\n  echo hwlat \u003e /sys/kernel/tracing/current_tracer\n  cat /sys/kernel/tracing/snapshot\n\nRather than teaching every user of tr-\u003ecurrent_trace_flags about this\ncorner case, make sure it is never NULL: when the newly selected\ntracer has no flags at all, tracing_set_tracer() falls back to a\nstatic empty no_tracer_flags. run_tracer_selftest() can hit the same\ncase, so the same fallback is added there too. The existing users\nalready handle opts == NULL, so these tracers keep behaving as before.","modified":"2026-10-30T02:47:30.344790702Z","published":"2026-10-28T10:34:52.091Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99141.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/3cc117514d69067a94d6c7479730dce41e678f50"},{"type":"WEB","url":"https://git.kernel.org/stable/c/b1547c6ba93b8863010aa324cd20c441f886f23e"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99141.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99141"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"e29aa918a928408c3e64b0d1025e4eb9f6fc549e"},{"fixed":"b1547c6ba93b8863010aa324cd20c441f886f23e"},{"fixed":"3cc117514d69067a94d6c7479730dce41e678f50"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-99141.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.2.13"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-99141.json"}}],"schema_version":"1.9.2"}