{"id":"CVE-2026-46011","aliases":["CVE-2026-46011"],"related":[],"kind":"vulnerability","state":"published","title":"media: mtk-jpeg: fix use-after-free in release path due to uncancelled work","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmedia: mtk-jpeg: fix use-after-free in release path due to uncancelled work\n\nThe mtk_jpeg_release() function frees the context structure (ctx) without\nfirst cancelling any pending or running work in ctx->jpeg_work. This\ncreates a race window where the workqueue callback may still be accessing\nthe context memory after it has been freed.\n\nRace condition:\n\n    CPU 0 (release)                    CPU 1 (workqueue)\n    ----------------                   ------------------\n    close()\n      mtk_jpeg_release()\n                                       mtk_jpegenc_worker()\n                                         ctx = work->data\n                                         // accessing ctx\n\n        kfree(ctx)  // freed!\n                                         access ctx  // UAF!\n\nThe work is queued via queue_work() during JPEG encode/decode operations\n(via mtk_jpeg_device_run). If the device is closed while work is pending\nor running, the work handler will access freed memory.\n\nFix this by calling cancel_work_sync() BEFORE acquiring the mutex. This\nordering is critical: if cancel_work_sync() is called after mutex_lock(),\nand the work handler also tries to acquire the same mutex, it would cause\na deadlock.\n\nNote: The open error path does NOT need cancel_work_sync() because\nINIT_WORK() only initializes the work structure - it does not schedule\nit. Work is only scheduled later during ioctl operations.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmedia: mtk-jpeg: fix use-after-free in release path due to uncancelled work\n\nThe mtk_jpeg_release() function frees the context structure (ctx) without\nfirst cancelling any pending or running work in ctx->jpeg_work. This\ncreates a race window where the workqueue callback may still be accessing\nthe context memory after it has been freed.\n\nRace condition:\n\n    CPU 0 (release)                    CPU 1 (workqueue)\n    ----------------                   ------------------\n    close()\n      mtk_jpeg_release()\n                                       mtk_jpegenc_worker()\n                                         ctx = work->data\n                                         // accessing ctx\n\n        kfree(ctx)  // freed!\n                                         access ctx  // UAF!\n\nThe work is queued via queue_work() during JPEG encode/decode operations\n(via mtk_jpeg_device_run). If the device is closed while work is pending\nor running, the work handler will access freed memory.\n\nFix this by calling cancel_work_sync() BEFORE acquiring the mutex. This\nordering is critical: if cancel_work_sync() is called after mutex_lock(),\nand the work handler also tries to acquire the same mutex, it would cause\na deadlock.\n\nNote: The open error path does NOT need cancel_work_sync() because\nINIT_WORK() only initializes the work structure - it does not schedule\nit. Work is only scheduled later during ioctl operations.","source":"cvelist"}],"published":"2026-05-27T12:56:13.198Z","modified":"2026-08-05T12:29:08.321Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"type":"git","introduced":"5fb1c2361e5630491d2a2f9359654eb022601bc0","fixed":"2209fdae5c2f615930c9af1379c1cfca199ec5d8","status":"affected"},{"type":"git","introduced":"5fb1c2361e5630491d2a2f9359654eb022601bc0","fixed":"0498b27a1542021d90269d58347501d4c3ccd84e","status":"affected"},{"type":"git","introduced":"5fb1c2361e5630491d2a2f9359654eb022601bc0","fixed":"26506a30e0e26d612f82a7bf0e395626968a44e6","status":"affected"},{"type":"git","introduced":"5fb1c2361e5630491d2a2f9359654eb022601bc0","fixed":"e78c39f720679fcf3a2eacd82725ec3ea2648301","status":"affected"},{"type":"git","introduced":"5fb1c2361e5630491d2a2f9359654eb022601bc0","fixed":"34c519feef3e4fcff1078dc8bdb25fbbbd10303f","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.6.140","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.86","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.27","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.0.4","lastAffected":"7.0.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.2","fixed":"6.6.140"},{"status":"affected","introduced":"6.7","fixed":"6.12.86"},{"status":"affected","introduced":"6.13","fixed":"6.18.27"},{"status":"affected","introduced":"6.19","fixed":"7.0.4"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/2209fdae5c2f615930c9af1379c1cfca199ec5d8","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0498b27a1542021d90269d58347501d4c3ccd84e","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/26506a30e0e26d612f82a7bf0e395626968a44e6","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e78c39f720679fcf3a2eacd82725ec3ea2648301","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/34c519feef3e4fcff1078dc8bdb25fbbbd10303f","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-46011","url":"https://www.cve.org/CVERecord?id=CVE-2026-46011","licence":"CVE Terms of Use","modified":"2026-08-05T12:29:08.321Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-46011","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46011","licence":"Public domain","modified":"2026-06-17T10:52:53.740Z"}],"updatedAt":"2026-11-25T22:59:22.544Z","epss":{"score":0.00125,"percentile":0.02388,"date":"2026-12-01T12:00:22.000Z"}}