CVE-2026-138907
published high CVSS 3.1 · 7.0media: mediatek: jpeg: Avoid context access after job finish
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux5827e4b14ee7882acc6d618c12ddf4966bbd780f to < 7e551afe3a5e9ad4f2b0258bbcdb963b61237070 · 5827e4b14ee7882acc6d618c12ddf4966bbd780f to < c5453ee719cdb222fab8306f48324eacf34501b4 · 5827e4b14ee7882acc6d618c12ddf4966bbd780f to < 7950f166957e1b4fedbe80bb717e69df94ba93bf · 5827e4b14ee7882acc6d618c12ddf4966bbd780f to < 38c433a0ec83a133daecbd4f380ec22a219f600a · 5827e4b14ee7882acc6d618c12ddf4966bbd780f to < 5da36fa408bb96a3e65dd1b5cc3f10ded3fed126 · 5827e4b14ee7882acc6d618c12ddf4966bbd780f to < e0dd33d541a80fb88527d09d910b9f2e7e05c167 · 5827e4b14ee7882acc6d618c12ddf4966bbd780f to < a2455ad533b121bf256392c6cd7cf205457a001e · 5827e4b14ee7882acc6d618c12ddf4966bbd780f to < 7c7f31405b76acd95a628c834ee8a2d6da439782 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux5.10 (affected) · 0 to < 5.10 (unaffected · semver) · 5.10.275 through 5.10.* (unaffected · semver) · 5.15.226 through 5.15.* (unaffected · semver) · 6.1.193 through 6.1.* (unaffected · semver) · 6.6.163 through 6.6.* (unaffected · semver) · 6.12.118 through 6.12.* (unaffected · semver) · 6.18.64 through 6.18.* (unaffected · semver) · 7.3.4 through 7.3.* (unaffected · semver) · 7.4-rc1 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: media: mediatek: jpeg: Avoid context access after job finish v4l2_m2m_job_finish() publishes job completion and wakes waiters before it returns. A concurrent file release can therefore finish v4l2_m2m_ctx_release() and free the context while the single-core IRQ handler continues with its tail. Both handlers only need the device for the matching runtime PM put. Use the IRQ-owned jpeg pointer instead of dereferencing ctx after completion has been published. This preserves the get/put pairing and removes the post-completion context access.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.0 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The stale ctx->jpeg load in mtk_jpeg_enc_done()/mtk_jpeg_dec_irq() is raced by mtk_jpeg_release() freeing ctx, so the attacker needs a local fd on the MediaTek JPEG m2m /dev/videoN node to queue a job (QBUF/STREAMON -> device_run) and then close() it. No remote data is involved. AC:H - Close must finish v4l2_m2m_ctx_release (two vb2_queue_release calls, kfree m2m_ctx), v4l2_ctrl_handler_free and kfree(ctx), then reclaim the slot. All of this has to fit between wake_up() in _v4l2_m2m_job_finish and the ctx->jpeg load in the same non-preemptible hardirq, a sub-microsecond window. The attacker cannot stall that CPU. PR:L - mtk_jpeg_open() and the V4L2 ioctl path have no capability checks. Access is gated only by /dev/videoN permissions (video group or the udev uaccess tag on video4linux devices), which a logged-in unprivileged user holds. UI:N - The attacker opens the node, queues the encode or decode job, and closes the fd on their own. No other user has to mount, open or run anything. S:U - The freed mtk_jpeg_ctx and the pm_runtime state it reaches are host-kernel memory in a single security authority. No VM, IOMMU or sandbox boundary is crossed. C:H - If the freed kmalloc'd mtk_jpeg_ctx is reclaimed, the attacker controls ctx->jpeg at offset 0 and the handler dereferences that pointer to fetch ->dev. This is a use of an attacker-supplied pointer in a heap UAF, usable as a building block for kernel memory disclosure. I:H - pm_runtime_put(ctx->jpeg->dev) on a forged device runs rpm_drop_usage_count(), an atomic decrement at an attacker-chosen address. If it hits zero it goes on to rpm_idle() with RPM_ASYNC on fake dev->power state, a write and control-flow primitive. A:H - If the race is won, a reclaimed ctx makes the handler follow a garbage jpeg/dev pointer, and init_on_free makes ctx->jpeg NULL. Either way the handler faults inside mtk_jpeg_enc_done()/mtk_jpeg_dec_irq() in hardirq context, which panics the kernel.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 5827e4b14ee7882acc6d618c12ddf4966bbd780f to < 7e551afe3a5e9ad4f2b0258bbcdb963b61237070 (affected · git)5827e4b14ee7882acc6d618c12ddf4966bbd780f to < c5453ee719cdb222fab8306f48324eacf34501b4 (affected · git)5827e4b14ee7882acc6d618c12ddf4966bbd780f to < 7950f166957e1b4fedbe80bb717e69df94ba93bf (affected · git)5827e4b14ee7882acc6d618c12ddf4966bbd780f to < 38c433a0ec83a133daecbd4f380ec22a219f600a (affected · git)5827e4b14ee7882acc6d618c12ddf4966bbd780f to < 5da36fa408bb96a3e65dd1b5cc3f10ded3fed126 (affected · git)5827e4b14ee7882acc6d618c12ddf4966bbd780f to < e0dd33d541a80fb88527d09d910b9f2e7e05c167 (affected · git)5827e4b14ee7882acc6d618c12ddf4966bbd780f to < a2455ad533b121bf256392c6cd7cf205457a001e (affected · git)5827e4b14ee7882acc6d618c12ddf4966bbd780f to < 7c7f31405b76acd95a628c834ee8a2d6da439782 (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 5.10 (affected)0 to < 5.10 (unaffected · semver)5.10.275 through 5.10.* (unaffected · semver)5.15.226 through 5.15.* (unaffected · semver)6.1.193 through 6.1.* (unaffected · semver)6.6.163 through 6.6.* (unaffected · semver)6.12.118 through 6.12.* (unaffected · semver)6.18.64 through 6.18.* (unaffected · semver)7.3.4 through 7.3.* (unaffected · semver)7.4-rc1 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
8- https://git.kernel.org/stable/c/38c433a0ec83a133daecbd4f380ec22a219f600a
- https://git.kernel.org/stable/c/5da36fa408bb96a3e65dd1b5cc3f10ded3fed126
- https://git.kernel.org/stable/c/7950f166957e1b4fedbe80bb717e69df94ba93bf
- https://git.kernel.org/stable/c/7c7f31405b76acd95a628c834ee8a2d6da439782
- https://git.kernel.org/stable/c/7e551afe3a5e9ad4f2b0258bbcdb963b61237070
- https://git.kernel.org/stable/c/a2455ad533b121bf256392c6cd7cf205457a001e
- https://git.kernel.org/stable/c/c5453ee719cdb222fab8306f48324eacf34501b4
- https://git.kernel.org/stable/c/e0dd33d541a80fb88527d09d910b9f2e7e05c167
Provider assertions
1Linux · cna
media: mediatek: jpeg: Avoid context access after job finish
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 33bf6dc78c9369cf5fae3a08d0c5473f52629818482e46a9f510348c0a6c15cb
- Ingested
- 01 Dec 2026, 05:47:22 UTC
- Source record
- Official CVE record