{"id":"CVE-2026-99140","aliases":["CVE-2026-99140"],"related":[],"kind":"vulnerability","state":"published","title":"tracing: Fix hist trigger timestamps for buffered events","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\ntracing: Fix hist trigger timestamps for buffered events\n\nSyzkaller triggered a WARN_ON_ONCE(!nest) warning:\n\n  WARNING: kernel/trace/ring_buffer.c:821 at ring_buffer_event_time_stamp\n  Call trace:\n    ring_buffer_event_time_stamp\n    hist_field_timestamp\n    hist_fn_call\n    event_hist_trigger\n    event_triggers_call\n    __event_trigger_test_discard\n    trace_event_buffer_commit\n    do_trace_event_raw_event_sched_switch\n    trace_event_raw_event_sched_switch\n\nThe warning is probabilistically reproducible and is related to syzkaller\nexecuting the following commands:\n\n  echo 'prev_pid == 999999' > events/sched/sched_switch/filter\n  echo 'hist:keys=common_timestamp' > events/sched/sched_switch/trigger\n\nThe specific triggering process is as follows:\n\nCPU 0                                           CPU 1\n(context switching)                             (echo 'hist:keys=common_timestamp' > \\\n                                                        events/sched/sched_switch/trigger)\ndo_trace_event_raw_event_##call\n  trace_event_buffer_lock_reserve\n    if (!tr->no_filter_buffering_ref &&\n        trace_file->flags & EVENT_FILE_FL_FILTERED)\n        return entry;  // return directly\n                                                event_hist_trigger_parse\n                                                  hist_register_trigger\n                                                    tracing_set_filter_buffering(file->tr, true);\n                                                      tr->no_filter_buffering_ref++;\n    __trace_buffer_lock_reserve\n      rb_start_commit\n        local_inc(&cpu_buffer->committing);  // skipped and not executed\n  trace_event_buffer_commit\n    __event_trigger_test_discard\n      event_triggers_call\n        event_hist_trigger\n          hist_fn_call\n            hist_field_timestamp\n              ring_buffer_event_time_stamp\n                nest = local_read(&cpu_buffer->committing);\n                WARN_ON_ONCE(!nest)  // trigger warning\n\nThe root cause is that when an event file has a filter attached and the\nhist trigger has not yet been attached, trace_event_buffer_lock_reserve()\nwrites the event into the per-CPU trace_buffered_event temp buffer instead\nof reserving it in the ring buffer, so cpu_buffer->committing is not\nincremented. When the event is later processed at commit time by a hist\ntrigger, hist_field_timestamp() -> ring_buffer_event_time_stamp() sees a\nzero committing count, triggering WARN_ON_ONCE(!nest).\n\ntracing_event_time_stamp() was added by commit d8279bfc5e959 (\"tracing:\nAdd tracing_event_time_stamp() API\") for exactly this case: if the event\nis the per-CPU trace_buffered_event, it returns the current ring buffer\ntimestamp. But it never gained a caller. Use it in hist_field_timestamp(),\nso that a hist trigger that races onto a buffered event records the\ncurrent time, which is only marginally later than when the event was\nrecorded, instead of warning and recording a bogus timestamp.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\ntracing: Fix hist trigger timestamps for buffered events\n\nSyzkaller triggered a WARN_ON_ONCE(!nest) warning:\n\n  WARNING: kernel/trace/ring_buffer.c:821 at ring_buffer_event_time_stamp\n  Call trace:\n    ring_buffer_event_time_stamp\n    hist_field_timestamp\n    hist_fn_call\n    event_hist_trigger\n    event_triggers_call\n    __event_trigger_test_discard\n    trace_event_buffer_commit\n    do_trace_event_raw_event_sched_switch\n    trace_event_raw_event_sched_switch\n\nThe warning is probabilistically reproducible and is related to syzkaller\nexecuting the following commands:\n\n  echo 'prev_pid == 999999' > events/sched/sched_switch/filter\n  echo 'hist:keys=common_timestamp' > events/sched/sched_switch/trigger\n\nThe specific triggering process is as follows:\n\nCPU 0                                           CPU 1\n(context switching)                             (echo 'hist:keys=common_timestamp' > \\\n                                                        events/sched/sched_switch/trigger)\ndo_trace_event_raw_event_##call\n  trace_event_buffer_lock_reserve\n    if (!tr->no_filter_buffering_ref &&\n        trace_file->flags & EVENT_FILE_FL_FILTERED)\n        return entry;  // return directly\n                                                event_hist_trigger_parse\n                                                  hist_register_trigger\n                                                    tracing_set_filter_buffering(file->tr, true);\n                                                      tr->no_filter_buffering_ref++;\n    __trace_buffer_lock_reserve\n      rb_start_commit\n        local_inc(&cpu_buffer->committing);  // skipped and not executed\n  trace_event_buffer_commit\n    __event_trigger_test_discard\n      event_triggers_call\n        event_hist_trigger\n          hist_fn_call\n            hist_field_timestamp\n              ring_buffer_event_time_stamp\n                nest = local_read(&cpu_buffer->committing);\n                WARN_ON_ONCE(!nest)  // trigger warning\n\nThe root cause is that when an event file has a filter attached and the\nhist trigger has not yet been attached, trace_event_buffer_lock_reserve()\nwrites the event into the per-CPU trace_buffered_event temp buffer instead\nof reserving it in the ring buffer, so cpu_buffer->committing is not\nincremented. When the event is later processed at commit time by a hist\ntrigger, hist_field_timestamp() -> ring_buffer_event_time_stamp() sees a\nzero committing count, triggering WARN_ON_ONCE(!nest).\n\ntracing_event_time_stamp() was added by commit d8279bfc5e959 (\"tracing:\nAdd tracing_event_time_stamp() API\") for exactly this case: if the event\nis the per-CPU trace_buffered_event, it returns the current ring buffer\ntimestamp. But it never gained a caller. Use it in hist_field_timestamp(),\nso that a hist trigger that races onto a buffered event records the\ncurrent time, which is only marginally later than when the event was\nrecorded, instead of warning and recording a bogus timestamp.","source":"cvelist"}],"published":"2026-10-28T10:34:51.421Z","modified":"2026-10-30T13:21:48.270Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"b94bc80df64823e676b506f8de7dcf6a688d681e","fixed":"b3a94a79047d3fc9385b3709cb2b86f4a26ed0c3","status":"affected"},{"type":"git","introduced":"b94bc80df64823e676b506f8de7dcf6a688d681e","fixed":"71c5c7420478d94d6eb0b427f66fa41bbda651e3","status":"affected"},{"type":"git","introduced":"b94bc80df64823e676b506f8de7dcf6a688d681e","fixed":"ab320f6aa3769480f735ed0ad026c4a61799b7bc","status":"affected"},{"type":"git","introduced":"b94bc80df64823e676b506f8de7dcf6a688d681e","fixed":"af192a356e9830a0df231b590ad6fb1fc28c9315","status":"affected"},{"type":"git","introduced":"b94bc80df64823e676b506f8de7dcf6a688d681e","fixed":"09c7cce2e59e6b3b1807520bcb1980c561f15d1e","status":"affected"},{"type":"git","introduced":"b94bc80df64823e676b506f8de7dcf6a688d681e","fixed":"89e90b16aadd6e66bd0323bc8dfc76a62e756b57","status":"affected"},{"type":"git","introduced":"b94bc80df64823e676b506f8de7dcf6a688d681e","fixed":"9414ca3b99e5a7f1f3bf51c2a01b383e1b355dd0","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.13","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.13","status":"unaffected"},{"type":"semver","introduced":"5.15.224","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.191","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.161","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.115","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.59","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.2.13","lastAffected":"7.2.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.3","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/b3a94a79047d3fc9385b3709cb2b86f4a26ed0c3","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/71c5c7420478d94d6eb0b427f66fa41bbda651e3","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ab320f6aa3769480f735ed0ad026c4a61799b7bc","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/af192a356e9830a0df231b590ad6fb1fc28c9315","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/09c7cce2e59e6b3b1807520bcb1980c561f15d1e","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/89e90b16aadd6e66bd0323bc8dfc76a62e756b57","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9414ca3b99e5a7f1f3bf51c2a01b383e1b355dd0","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-99140","url":"https://www.cve.org/CVERecord?id=CVE-2026-99140","licence":"CVE Terms of Use","modified":"2026-10-30T12:42:12.896Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-99140","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99140","licence":"Public domain","modified":"2026-10-30T13:21:48.270Z"}],"updatedAt":"2026-11-25T22:59:47.575Z","epss":{"score":0.00206,"percentile":0.113,"date":"2026-12-01T12:00:22.000Z"}}