CVE-2026-99140 in Linux
要約
〜によって VulDB • 2026年10月28日
Linuxカーネルにおいて、以下の脆弱性が修正されました:
tracing: バッファリングされたイベントに対する hist トリガーのタイムスタンプを修正
Syzkaller によって `WARN_ON_ONCE(!nest)` ウォーニングが引き起こされました:
``` WARNING: kernel/trace/ring_buffer.c:821 at ring_buffer_event_time_stamp Call trace: ring_buffer_event_time_stamp hist_field_timestamp hist_fn_call event_hist_trigger event_triggers_call __event_trigger_test_discard trace_event_buffer_commit do_trace_event_raw_event_sched_switch trace_event_raw_event_sched_switch ```
このウォーニングは確率的に再現可能であり、Syzkaller が以下のコマンドを実行することに起因します:
``` echo 'prev_pid == 999999' > events/sched/sched_switch/filter echo 'hist:keys=common_timestamp' > events/sched/sched_switch/trigger ```
具体的なトリガープロセスは以下の通りです:
CPU 0 CPU 1 (context switching) (echo 'hist:keys=common_timestamp' > \ events/sched/sched_switch/trigger を実行) do_trace_event_raw_event_##call trace_event_buffer_lock_reserve if (!tr->no_filter_buffering_ref && trace_file->flags & EVENT_FILE_FL_FILTERED) return entry; // ここで直接戻る event_hist_trigger_parse hist_register_trigger tracing_set_filter_buffering(file->tr, true); tr->no_filter_buffering_ref++; __trace_buffer_lock_reserve rb_start_commit local_inc(&cpu_buffer->committing); // スキップされ、実行されない trace_event_buffer_commit __event_trigger_test_discard event_triggers_call event_hist_trigger hist_fn_call hist_field_timestamp ring_buffer_event_time_stamp nest = local_read(&cpu_buffer->committing); WARN_ON_ONCE(!nest) // ウォーニングを発生させる
根本原因は、イベントファイルにフィルタが設定されており、かつ hist トリガーがまだアタッチされていない場合、`trace_event_buffer_lock_reserve()` がリングバッファ内に予約するのではなく、per-CPU の `trace_buffered_event` 一時バッファへイベントを書き込むためです。その結果、`cpu_buffer->committing` カウンタが増分されません。その後、hist トリガーによってコミット時にイベントが処理される際、`hist_field_timestamp()` -> `ring_buffer_event_time_stamp()` はゼロの committing カウントを検出し、`WARN_ON_ONCE(!nest)` をトリガーします。
`tracing_event_time_stamp()` API は、このケースのために commit d8279bfc5e959 ("tracing: Add tracing_event_time_stamp() API") によって追加されました:もしイベントが per-CPU の `trace_buffered_event` であれば、現在のリングバッファタイムスタンプを返すものです。しかし、その呼び出し元は一度も実装されませんでした。これを `hist_field_timestamp()` で使用することで、バッファリングされたイベントに対して競合状態(race condition)で実行される hist トリガーが、ウォーニングを発して偽のタイムスタンプを記録するのではなく、現在時刻(これはイベントが記録された時点からわずかに遅い時間です)を記録するようにします。
Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.