{"id":"CVE-2026-99468","aliases":["CVE-2026-99468"],"related":[],"kind":"vulnerability","state":"published","title":"media: imx-jpeg: cancel timeout worker when streaming stops","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmedia: imx-jpeg: cancel timeout worker when streaming stops\n\nEach per-fd context ctx owns a delayed_work (ctx->task_timer, callback\nmxc_jpeg_device_run_timeout) armed via schedule_delayed_work() at the end\nof mxc_jpeg_device_run() to recover a stalled encode/decode job. The only\nexisting cancellation is cancel_delayed_work() in the frame-done IRQ\nhandler, which de-queues a pending work item but does not wait for a\ncallback that has already started, and it only runs when a frame completes.\n\nWhen the fd is closed while a job is in flight (the frame-done IRQ has not\nfired yet), nothing syncs the worker before mxc_jpeg_release() frees ctx\nwith kfree() after v4l2_m2m_ctx_release(). A queued or executing\nmxc_jpeg_device_run_timeout() can then recover ctx through\ncontainer_of(&ctx->task_timer) and dereference it (ctx->mxc_jpeg,\nslot_data, dev_warn) after ctx has been freed.\n\nCancel the worker from mxc_jpeg_stop_streaming(). The cancel cannot live\nin mxc_jpeg_release(): mxc_jpeg_device_run() arms the timer while holding\nonly hw_lock, not the mxc_jpeg->lock mutex that release holds, so a cancel\nin release could still race a concurrent mxc_jpeg_device_run() that\nre-arms the timer afterwards. mxc_jpeg_stop_streaming() instead runs inside\nv4l2_m2m_ctx_release() -> vb2_queue_release(), i.e. after\nv4l2_m2m_cancel_job() has set TRANS_ABORT and waited for any in-flight job\nto finish (so __v4l2_m2m_try_queue() will not queue and v4l2_m2m_try_run()\nwill not run any further job for this context, which prevents\nmxc_jpeg_device_run() from re-arming the timer) and before the m2m context\nis freed. cancel_delayed_work_sync() removes a pending work item and waits\nfor a running callback, so the worker can no longer race with the\nsubsequent kfree(). The cancel is placed before the buffer-release loop so\na concurrently running timeout callback cannot race with it over the same\nbuffers. If the frame-done IRQ canceled a still-pending timer, this cancel\nis a no-op; if the timeout callback has already started, it waits for the\ncallback to finish. The same mxc_jpeg_stop_streaming() call is also\nreached from VIDIOC_STREAMOFF, which drains the worker early, although\nSTREAMOFF itself does not free ctx -- the use-after-free arises only\nwhen the fd is later closed.\n\nThis bug was found by static analysis.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmedia: imx-jpeg: cancel timeout worker when streaming stops\n\nEach per-fd context ctx owns a delayed_work (ctx->task_timer, callback\nmxc_jpeg_device_run_timeout) armed via schedule_delayed_work() at the end\nof mxc_jpeg_device_run() to recover a stalled encode/decode job. The only\nexisting cancellation is cancel_delayed_work() in the frame-done IRQ\nhandler, which de-queues a pending work item but does not wait for a\ncallback that has already started, and it only runs when a frame completes.\n\nWhen the fd is closed while a job is in flight (the frame-done IRQ has not\nfired yet), nothing syncs the worker before mxc_jpeg_release() frees ctx\nwith kfree() after v4l2_m2m_ctx_release(). A queued or executing\nmxc_jpeg_device_run_timeout() can then recover ctx through\ncontainer_of(&ctx->task_timer) and dereference it (ctx->mxc_jpeg,\nslot_data, dev_warn) after ctx has been freed.\n\nCancel the worker from mxc_jpeg_stop_streaming(). The cancel cannot live\nin mxc_jpeg_release(): mxc_jpeg_device_run() arms the timer while holding\nonly hw_lock, not the mxc_jpeg->lock mutex that release holds, so a cancel\nin release could still race a concurrent mxc_jpeg_device_run() that\nre-arms the timer afterwards. mxc_jpeg_stop_streaming() instead runs inside\nv4l2_m2m_ctx_release() -> vb2_queue_release(), i.e. after\nv4l2_m2m_cancel_job() has set TRANS_ABORT and waited for any in-flight job\nto finish (so __v4l2_m2m_try_queue() will not queue and v4l2_m2m_try_run()\nwill not run any further job for this context, which prevents\nmxc_jpeg_device_run() from re-arming the timer) and before the m2m context\nis freed. cancel_delayed_work_sync() removes a pending work item and waits\nfor a running callback, so the worker can no longer race with the\nsubsequent kfree(). The cancel is placed before the buffer-release loop so\na concurrently running timeout callback cannot race with it over the same\nbuffers. If the frame-done IRQ canceled a still-pending timer, this cancel\nis a no-op; if the timeout callback has already started, it waits for the\ncallback to finish. The same mxc_jpeg_stop_streaming() call is also\nreached from VIDIOC_STREAMOFF, which drains the worker early, although\nSTREAMOFF itself does not free ctx -- the use-after-free arises only\nwhen the fd is later closed.\n\nThis bug was found by static analysis.","source":"cvelist"}],"published":"2026-11-19T14:42:54.426Z","modified":"2026-11-23T08:17:50.400Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"1f3367fa4210f37417cd55622b3872ababd2f06d","fixed":"e5127281b5869ee8279b7790d059180476daeb62","status":"affected"},{"type":"git","introduced":"cfed9632ca8e8bdf0128745ae2400b72c4292886","fixed":"699777bac0c3a7c33bd63b2536d1ab5562392f24","status":"affected"},{"type":"git","introduced":"cfed9632ca8e8bdf0128745ae2400b72c4292886","fixed":"77e1c41d65a9f3cd22d73d0ec1f33cf6cd37b341","status":"affected"},{"type":"git","introduced":"cfed9632ca8e8bdf0128745ae2400b72c4292886","fixed":"49a0623994a10d3d333d48c304f89d816495f332","status":"affected"},{"type":"git","introduced":"cfed9632ca8e8bdf0128745ae2400b72c4292886","fixed":"9e393784a902bb4eb00a21e46d389a32c7ea61b0","status":"affected"},{"type":"git","introduced":"cfed9632ca8e8bdf0128745ae2400b72c4292886","fixed":"78fdfbf117c409273eecbfa7a528ef42358a0e38","status":"affected"},{"type":"semver","introduced":"6.1.143","fixed":"6.1.193","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.2","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.2","status":"unaffected"},{"type":"semver","introduced":"6.1.193","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.163","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.117","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.61","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.2","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","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/e5127281b5869ee8279b7790d059180476daeb62","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/699777bac0c3a7c33bd63b2536d1ab5562392f24","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/77e1c41d65a9f3cd22d73d0ec1f33cf6cd37b341","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/49a0623994a10d3d333d48c304f89d816495f332","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9e393784a902bb4eb00a21e46d389a32c7ea61b0","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/78fdfbf117c409273eecbfa7a528ef42358a0e38","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-99468","url":"https://www.cve.org/CVERecord?id=CVE-2026-99468","licence":"CVE Terms of Use","modified":"2026-11-23T08:03:12.318Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-99468","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99468","licence":"Public domain","modified":"2026-11-23T08:17:50.400Z"}],"updatedAt":"2026-11-25T22:59:52.081Z","epss":{"score":0.00155,"percentile":0.04915,"date":"2026-12-01T12:00:22.000Z"}}