{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2026-138907",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2026-11-30T13:22:15.902Z",
        "datePublished": "2026-11-30T13:26:05.767Z",
        "dateUpdated": "2026-12-01T05:40:38.072Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-12-01T05:40:38.072Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nmedia: mediatek: jpeg: Avoid context access after job finish\n\nv4l2_m2m_job_finish() publishes job completion and wakes waiters\nbefore it returns. A concurrent file release can therefore finish\nv4l2_m2m_ctx_release() and free the context while the single-core IRQ\nhandler continues with its tail.\n\nBoth handlers only need the device for the matching runtime PM put.\nUse the IRQ-owned jpeg pointer instead of dereferencing ctx after\ncompletion has been published. This preserves the get/put pairing and\nremoves the post-completion context access."
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
                        "baseScore": 7,
                        "baseSeverity": "HIGH"
                    },
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "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.\nAC: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.\nPR: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.\nUI: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.\nS: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.\nC: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.\nI: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.\nA: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."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c"
                    ],
                    "versions": [
                        {
                            "version": "5827e4b14ee7882acc6d618c12ddf4966bbd780f",
                            "lessThan": "7e551afe3a5e9ad4f2b0258bbcdb963b61237070",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "5827e4b14ee7882acc6d618c12ddf4966bbd780f",
                            "lessThan": "c5453ee719cdb222fab8306f48324eacf34501b4",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "5827e4b14ee7882acc6d618c12ddf4966bbd780f",
                            "lessThan": "7950f166957e1b4fedbe80bb717e69df94ba93bf",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "5827e4b14ee7882acc6d618c12ddf4966bbd780f",
                            "lessThan": "38c433a0ec83a133daecbd4f380ec22a219f600a",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "5827e4b14ee7882acc6d618c12ddf4966bbd780f",
                            "lessThan": "5da36fa408bb96a3e65dd1b5cc3f10ded3fed126",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "5827e4b14ee7882acc6d618c12ddf4966bbd780f",
                            "lessThan": "e0dd33d541a80fb88527d09d910b9f2e7e05c167",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "5827e4b14ee7882acc6d618c12ddf4966bbd780f",
                            "lessThan": "a2455ad533b121bf256392c6cd7cf205457a001e",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "5827e4b14ee7882acc6d618c12ddf4966bbd780f",
                            "lessThan": "7c7f31405b76acd95a628c834ee8a2d6da439782",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c"
                    ],
                    "versions": [
                        {
                            "version": "5.10",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "5.10",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.10.275",
                            "lessThanOrEqual": "5.10.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.15.226",
                            "lessThanOrEqual": "5.15.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.1.193",
                            "lessThanOrEqual": "6.1.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.6.163",
                            "lessThanOrEqual": "6.6.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.12.118",
                            "lessThanOrEqual": "6.12.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.18.64",
                            "lessThanOrEqual": "6.18.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "7.3.4",
                            "lessThanOrEqual": "7.3.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "7.4-rc1",
                            "lessThanOrEqual": "*",
                            "status": "unaffected",
                            "versionType": "original_commit_for_fix"
                        }
                    ]
                }
            ],
            "cpeApplicability": [
                {
                    "nodes": [
                        {
                            "operator": "OR",
                            "negate": false,
                            "cpeMatch": [
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.10",
                                    "versionEndExcluding": "5.10.275"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.10",
                                    "versionEndExcluding": "5.15.226"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.10",
                                    "versionEndExcluding": "6.1.193"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.10",
                                    "versionEndExcluding": "6.6.163"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.10",
                                    "versionEndExcluding": "6.12.118"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.10",
                                    "versionEndExcluding": "6.18.64"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.10",
                                    "versionEndExcluding": "7.3.4"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.10",
                                    "versionEndExcluding": "7.4-rc1"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/7e551afe3a5e9ad4f2b0258bbcdb963b61237070"
                },
                {
                    "url": "https://git.kernel.org/stable/c/c5453ee719cdb222fab8306f48324eacf34501b4"
                },
                {
                    "url": "https://git.kernel.org/stable/c/7950f166957e1b4fedbe80bb717e69df94ba93bf"
                },
                {
                    "url": "https://git.kernel.org/stable/c/38c433a0ec83a133daecbd4f380ec22a219f600a"
                },
                {
                    "url": "https://git.kernel.org/stable/c/5da36fa408bb96a3e65dd1b5cc3f10ded3fed126"
                },
                {
                    "url": "https://git.kernel.org/stable/c/e0dd33d541a80fb88527d09d910b9f2e7e05c167"
                },
                {
                    "url": "https://git.kernel.org/stable/c/a2455ad533b121bf256392c6cd7cf205457a001e"
                },
                {
                    "url": "https://git.kernel.org/stable/c/7c7f31405b76acd95a628c834ee8a2d6da439782"
                }
            ],
            "title": "media: mediatek: jpeg: Avoid context access after job finish",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        }
    }
}