脆弱性ウォッチ

新着 / 2026年11月26日 / CVE-2026-102957

Zephyr PWMキャプチャ処理の未初期化スタック参照による脆弱性

重要 7.7

掲載

何が問題か

Zephyrのドライバ(drivers/pwm/pwm_capture.c)のpwm_capture_cycles()で、タイムアウトにK_NO_WAITが指定された場合にエラー処理が欠けており、未初期化の値を返すことや、カーネルスタック上の無効になったポインタをキャプチャ完了時に参照することが問題になります。ユーザーモードのスレッドからシステムコール経由で呼び出せる条件が記載されています。修正版の番号は公表されていません。

悪用されると

ユーザーモードから悪用されると、カーネルスタックの残存データが読み取られるほか、割り込み文脈でカーネルメモリが破壊され、少なくともクラッシュに至る可能性があります。権限昇格の可能性も記載されていますが、実際の悪用状況は公表されていません。

取るべき対応

Zephyrを利用している場合は、修正が含まれる公式リリースや修正コミットの公開状況を確認し、該当バージョンへの更新を検討してください。修正版の番号は公表されていません。

AIが出典から要約し、数値を機械照合しています。

更新履歴

  1. 初回掲載。

指標

深刻度(CVSS v3.1)重要 7.7
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:L/I:H/A:H
実際の攻撃での悪用CISA KEVには未掲載
問題の種類CWE-825
CVE公開日2026-11-25

出典

公式の説明(英語の原文)

z_impl_pwm_capture_cycles() in drivers/pwm/pwm_capture.c stores its capture context (struct z_pwm_capture_cb_data, including a struct k_sem) on its own stack and registers a pointer to it as the driver capture callback's user_data. When called with a K_NO_WAIT timeout, k_sem_take() returns -EBUSY, which the function did not handle: it fell through, returned the uninitialized status field, copied uninitialized period/pulse values to the caller when that status happened to be zero, and returned without disabling the capture or clearing the callback. pwm_capture_cycles() is a system call, and z_vrfy_pwm_capture_cycles() passes the caller's timeout through unchanged. With CONFIG_USERSPACE and CONFIG_PWM_CAPTURE enabled, an unprivileged user-mode thread that has been granted access to a capture-capable PWM device can pass K_NO_WAIT to trigger the defect. Without userspace the function is only reachable from trusted application code. The uninitialized values come from the thread's privileged (kernel) stack, so a user-mode caller can read up to 8 bytes of stale kernel stack memory per call. More seriously, when the capture later completes, the driver ISR invokes z_pwm_capture_cycles_callback() with the dangling pointer. The callback writes into the expired kernel stack region and calls k_sem_give() on whatever memory now occupies it, which can corrupt live kernel stack frames and make the scheduler walk a forged wait queue. The result is kernel memory corruption from interrupt context, leading at least to a crash and possibly to privilege escalation out of the userspace sandbox. The fix rejects K_NO_WAIT with -EINVAL before any capture is configured.