Ad

CVE-2026-99468

HIGH CVSS 3.1: 7,0 EPSS 0.15%
Обновлено 23 ноября 2026
Linux
Параметр Значение
CVSS 7,0 (HIGH)
Поставщик Linux
Публичный эксплойт Нет

В ядре Linux была устранена следующая уязвимость: media: imx-jpeg: cancel timeout worker when streaming stops Each per-fd context ctx владеет delayed_work (ctx->task_timer, callback mxc_jpeg_device_run_timeout), вооружённым через schedule_delayed_work() в конце mxc_jpeg_device_run() для восстановления заглохнутого задания кодирования/декодирования. Единственная существующая отмена - это cancel_delayed_work () в обработчике IRQ, который сворачивает ожидающий элемент работы, но не ждет обратного вызова, который уже начался, и он запускается только тогда, когда кадр завершается. Когда fd закрыт, пока работа находится в полете (сделанный кадр IRQ еще не выстрелил), ничто не синхронизирует рабочего перед mxc_jpeg_release() освобождает ctx с kfree() после v4l2_m2m_ctx_release().

Очередь или выполнение mxc_jpeg_device_run_timeout() может затем восстановить ctx через container_of(&ctx->task_timer) и дереферировать его (ctx->mxc_jpeg, slot_data, dev_warn) после освобождения ctx. Отмена работника из mxc_jpeg_stop_streaming(). The cancel cannot live in mxc_jpeg_release(): mxc_jpeg_device_run() arms the timer while holding only hw_lock, not the mxc_jpeg->lock mutex that release holds, so a cancel in release could still race a concurrent mxc_jpeg_device_run() that re-arms the timer afterwards. mxc_jpeg_stop_streaming() instead runs inside v4l2_m2m_ctx_release() -> vb2_queue_release(), i.e. after v4l2_m2m_cancel_job() has set TRANS_ABORT and waited for any in-flight job to finish (so __v4l2_m2m_try_queue() will not queue and v4l2_m2m_try_run() will not run any further job for this context, which prevents mxc_jpeg_device_run() from re-arming the timer) and before the m2m context is freed. cancel_delayed_work_sync() removes a pending work item and waits for a running callback, so the worker can no longer race with the subsequent kfree().

Отмена помещается перед циклом освобождения буфера, поэтому одновременный вызов таймаут не может гоняться с ним по тем же буферам. Если IRQ отменил все еще ожидающий таймер, эта отмена невозможна; если обратный вызов таймаут уже начался, он ждет окончания обратного звонка. Тот же вызов mxc_jpeg_stop_streaming() также достигается от VIDIOC_STREAMOFF, что рано истощает рабочего, хотя сам STREAMOFF не освобождает ctx — use-after-free возникает только при последующем закрытии fd.

Эта ошибка была обнаружена статическим анализом.

Показать оригинальное описание (EN)

In the Linux kernel, the following vulnerability has been resolved: media: imx-jpeg: cancel timeout worker when streaming stops Each per-fd context ctx owns a delayed_work (ctx->task_timer, callback mxc_jpeg_device_run_timeout) armed via schedule_delayed_work() at the end of mxc_jpeg_device_run() to recover a stalled encode/decode job. The only existing cancellation is cancel_delayed_work() in the frame-done IRQ handler, which de-queues a pending work item but does not wait for a callback that has already started, and it only runs when a frame completes. When the fd is closed while a job is in flight (the frame-done IRQ has not fired yet), nothing syncs the worker before mxc_jpeg_release() frees ctx with kfree() after v4l2_m2m_ctx_release(). A queued or executing mxc_jpeg_device_run_timeout() can then recover ctx through container_of(&ctx->task_timer) and dereference it (ctx->mxc_jpeg, slot_data, dev_warn) after ctx has been freed. Cancel the worker from mxc_jpeg_stop_streaming(). The cancel cannot live in mxc_jpeg_release(): mxc_jpeg_device_run() arms the timer while holding only hw_lock, not the mxc_jpeg->lock mutex that release holds, so a cancel in release could still race a concurrent mxc_jpeg_device_run() that re-arms the timer afterwards. mxc_jpeg_stop_streaming() instead runs inside v4l2_m2m_ctx_release() -> vb2_queue_release(), i.e. after v4l2_m2m_cancel_job() has set TRANS_ABORT and waited for any in-flight job to finish (so __v4l2_m2m_try_queue() will not queue and v4l2_m2m_try_run() will not run any further job for this context, which prevents mxc_jpeg_device_run() from re-arming the timer) and before the m2m context is freed. cancel_delayed_work_sync() removes a pending work item and waits for a running callback, so the worker can no longer race with the subsequent kfree(). The cancel is placed before the buffer-release loop so a concurrently running timeout callback cannot race with it over the same buffers. If the frame-done IRQ canceled a still-pending timer, this cancel is a no-op; if the timeout callback has already started, it waits for the callback to finish. The same mxc_jpeg_stop_streaming() call is also reached from VIDIOC_STREAMOFF, which drains the worker early, although STREAMOFF itself does not free ctx -- the use-after-free arises only when the fd is later closed. This bug was found by static analysis.

Характеристики атаки

Способ атаки
Локальный
Нужен локальный доступ
Сложность
Высокая
Сложно эксплуатировать
Нужны права
Низкие
Нужны базовые права
Участие пользователя
Не требуется
Не нужно действие пользователя

Последствия

Конфиденциальность
Высокое
Полная утечка данных
Целостность
Высокое
Полная модификация данных
Доступность
Высокое
Полный отказ в обслуживании

Строка CVSS v3.1