Skip to main content

Linux Kernel CVE-2026-31584

| EUVDEUVD-2026-25477 HIGH
Use After Free (CWE-416)
2026-04-24 Linux GHSA-5g36-g7f3-8q34
7.8
CVSS 3.1 · Vendor: Linux
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Gain local authenticated access
  2. Delivery
    Open MediaTek vcodec encoder device
  3. Exploit
    Queue encoding work via V4L2 ioctl
  4. Install
    Close file descriptor to trigger release
  5. C2
    Win race between kfree(ctx) and worker execution
  6. Execute
    Corrupt freed memory with controlled allocation
  7. Impact
    Execute arbitrary code in kernel context

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Memory lifecycle management
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires local authenticated access with low privileges (CVSS PR:L) to a Linux system containing MediaTek video codec hardware and running an affected kernel version. The attacker must have permission to open video encoding device nodes (typically /dev/video* devices with mtk-vcodec-enc driver, usually accessible to users in the 'video' group or with CAP_SYS_ADMIN). The vulnerability is specific to the MediaTek vcodec encoder driver, so systems without MediaTek SoCs or those with the mtk_vcodec_enc module disabled/blacklisted are not exploitable. No user interaction required (UI:N) once device access is available. Exploitation is limited by the need for precise timing to win the race condition between context free and workqueue execution, though KASAN testing confirms reliable reproduction is possible. The attack vector is local only (AV:L) - remote exploitation requires chaining with a separate remote code execution or authentication bypass vulnerability to first gain local access.

Impact

Real-world risk is moderate and highly constrained by exploitation requirements. CVSS 7.8 reflects high impact (memory corruption enabling code execution, data disclosure, and denial of service) but requires local authenticated access with low privileges (AV:L/PR:L). The EPSS score of 0.02% (5th percentile) indicates negligible probability of widespread automated exploitation in the wild. No public exploit identified at time of analysis and not listed in CISA KEV, suggesting this remains a theoretical vulnerability without confirmed active exploitation. The vulnerability affects only systems using MediaTek hardware video encoding capabilities, significantly narrowing the attack surface compared to generic kernel vulnerabilities. Attack complexity is low (AC:L) once local access is obtained, and the KASAN-confirmed reproduction demonstrates reliable exploitability under laboratory conditions. Priority should be moderate: important to patch on affected MediaTek-based systems with untrusted local users (shared hosting, multi-tenant environments), but not an emergency for single-user workstations or systems without MediaTek video hardware. The availability of vendor patches across multiple stable kernel branches (6.12.83, 6.18.24, 6.19.14, 7.0.1) enables straightforward remediation. SSVC decision factors: exploitation status is none, automatable is no (requires local access and specific hardware), technical impact is total (arbitrary code execution in kernel context) - overall priority is scheduled patching within normal maintenance windows for most environments.

Exploit ScenarioDerived

An authenticated local user on a Linux system with MediaTek hardware video encoding opens the vcodec encoder device (/dev/video*) and initiates a video encoding operation, causing the mtk_venc_worker workqueue to be scheduled. The attacker then immediately closes the device file descriptor, triggering fops_vcodec_release() which frees the context structure while the workqueue handler is still executing. By precisely timing the race window between v4l2_m2m_job_finish() and subsequent context dereferencing in the worker thread, the attacker triggers a use-after-free condition. With knowledge of kernel memory layout (obtainable via other info-leak vulnerabilities or KASLR bypasses), the attacker could reallocate the freed context memory with controlled data, corrupting kernel structures or function pointers to achieve arbitrary code execution in kernel context.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Apr 27, 2026

Use-after-free in Linux kernel MediaTek video encoder allows local authenticated users to corrupt memory and potentially execute arbitrary code. The flaw affects the vcodec driver's encoder release path where ctx memory is freed before canceling scheduled workqueue tasks, enabling race conditions between cleanup and worker threads that may dereference freed memory. KASAN-confirmed exploitation requires local access with low privileges (CVSS AV:L/PR:L). Patches available for kernel versions 6.12.83, 6.18.24, 6.19.14, and 7.0.1. EPSS score of 0.02% (5th percentile) indicates very low probability of automated exploitation, with no public exploit identified at time of analysis.

RemediationAI

Upgrade to patched Linux kernel versions: 6.12.83, 6.18.24, 6.19.14, 7.0.1, or later stable releases that include the fix commits. Patches available from kernel.org stable tree at https://git.kernel.org/stable/c/a8a55913552aed45108525d1851c65e1db0cc25b (mainline), https://git.kernel.org/stable/c/f99353cd0e9f58bf17889049137b8d65fb44ebf1 (6.19.x), https://git.kernel.org/stable/c/93d9a58961a9e09306857e999b3ee76aa4be67f0 (6.12.x), and https://git.kernel.org/stable/c/f1692337c6fa26e04f89b22a4d84bf5b7ada50d1 (6.18.x). The fix adds cancel_work_sync(&ctx->encode_work) before kfree(ctx) in the release path to ensure workqueue synchronization. If immediate patching is not feasible, disable or restrict access to MediaTek video encoding devices (/dev/video* nodes associated with mtk-vcodec-enc) using udev rules or device permissions to limit exposure to trusted users only - this prevents untrusted local users from triggering the vulnerable code path but eliminates hardware video encoding functionality. Alternatively, blacklist the mtk_vcodec_enc kernel module (add 'blacklist mtk_vcodec_enc' to /etc/modprobe.d/blacklist.conf) to prevent driver loading entirely, trading off all MediaTek hardware video encoding for security. Both workarounds significantly degrade multimedia performance on affected systems and should only be temporary measures pending kernel upgrade.

Affected VersionsENISA

Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 <93d9a58961a9e09306857e999b3ee76aa4be67f0
Linux patch: 6.12.83
Linux patch: 6.18.24
Linux patch: 7.0.1
Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 <f1692337c6fa26e04f89b22a4d84bf5b7ada50d1
Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 <f99353cd0e9f58bf17889049137b8d65fb44ebf1
Linux patch: 6.19.14
Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 <a8a55913552aed45108525d1851c65e1db0cc25b

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

This vulnerability resides in the MediaTek vcodec video encoder driver within the Linux kernel's V4L2 (Video4Linux2) subsystem. The affected code path involves the interaction between the V4L2 mem2mem (memory-to-memory) framework and kernel workqueues. The fops_vcodec_release() function uses v4l2_m2m_ctx_release() to clean up media contexts, which synchronizes on the m2m job lifecycle via the TRANS_RUNNING flag. However, this synchronization mechanism only waits for v4l2_m2m_job_finish() to complete, not for the underlying workqueue handler (mtk_venc_worker) to finish execution. The workqueue is scheduled via queue_work() during encoding operations and continues accessing context structure fields (ctx->m2m_ctx, ctx->dev) after the job is marked done. The CPE strings indicate this affects the core Linux kernel package across multiple stable branches. The root cause is a classic time-of-check-to-time-of-use (TOCTOU) race condition where synchronization primitives protect one resource lifecycle (m2m job) but not the dependent resource (workqueue execution) that continues to reference the freed context structure.

Know when Mediatek gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (Linux) PRIMARY 7.8 HIGH
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
SUSE HIGH

Primary rating from Vendor (Linux).

CVSS VectorVendor: Linux

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

4
Patch released
Apr 27, 2026 - 20:20 nvd
Patch available
CVSS changed
Apr 27, 2026 - 15:22 NVD
7.8 (HIGH)
Patch available
Apr 24, 2026 - 16:16 EUVD
CVE Published
Apr 24, 2026 - 14:42 nvd
HIGH 7.8

DescriptionCVE.org

In the Linux kernel, the following vulnerability has been resolved:

media: mediatek: vcodec: fix use-after-free in encoder release path

The fops_vcodec_release() function frees the context structure (ctx) without first cancelling any pending or running work in ctx->encode_work. This creates a race window where the workqueue handler (mtk_venc_worker) may still be accessing the context memory after it has been freed.

Race condition:

CPU 0 (release path) CPU 1 (workqueue) --------------------- ------------------ fops_vcodec_release() v4l2_m2m_ctx_release() v4l2_m2m_cancel_job() // waits for m2m job "done" mtk_venc_worker() v4l2_m2m_job_finish() // m2m job "done" // BUT worker still running! // post-job_finish access: other ctx dereferences // UAF if ctx already freed // returns (job "done") kfree(ctx) // ctx freed

Root cause: The v4l2_m2m_ctx_release() only waits for the m2m job lifecycle (via TRANS_RUNNING flag), not the workqueue lifecycle. After v4l2_m2m_job_finish() is called, the m2m framework considers the job complete and v4l2_m2m_ctx_release() returns, but the worker function continues executing and may still access ctx.

The work is queued during encode operations via: queue_work(ctx->dev->encode_workqueue, &ctx->encode_work) The worker function accesses ctx->m2m_ctx, ctx->dev, and other ctx fields even after calling v4l2_m2m_job_finish().

This vulnerability was confirmed with KASAN by running an instrumented test module that widens the post-job_finish race window. KASAN detected:

BUG: KASAN: slab-use-after-free in mtk_venc_worker+0x159/0x180 Read of size 4 at addr ffff88800326e000 by task kworker/u8:0/12

Workqueue: mtk_vcodec_enc_wq mtk_venc_worker

Allocated by task 47: __kasan_kmalloc+0x7f/0x90 fops_vcodec_open+0x85/0x1a0

Freed by task 47: __kasan_slab_free+0x43/0x70 kfree+0xee/0x3a0 fops_vcodec_release+0xb7/0x190

Fix this by calling cancel_work_sync(&ctx->encode_work) before kfree(ctx). This ensures the workqueue handler is both cancelled (if pending) and synchronized (waits for any running handler to complete) before the context is freed.

Placement rationale: The fix is placed after v4l2_ctrl_handler_free() and before list_del_init(&ctx->list). At this point, all m2m operations are done (v4l2_m2m_ctx_release() has returned), and we need to ensure the workqueue is synchronized before removing ctx from the list and freeing it.

Note: The open error path does NOT need cancel_work_sync() because INIT_WORK() only initializes the work structure - it does not schedule it. Work is only scheduled later during device_run() operations.

Executive ViewAI

Why It Matters

CVE-2026-31584 is a use-after-free vulnerability in the Linux kernel's MediaTek video encoder driver that allows authenticated local users to corrupt memory and potentially execute arbitrary code. Organizations running affected kernel versions face risk from insider threats or compromised local accounts with low-privilege access, particularly in environments where multiple users share system access or virtualized infrastructure is present.

Business Impact: Medium
Compensating Controls

Apply vendor patch. If immediate patching cannot occur: restrict local user access through privilege separation and mandatory access controls (SELinux/AppArmor); disable MediaTek video encoder functionality if not actively required; isolate affected systems from networks where untrusted local users can obtain access; monitor kernel logs for KASAN warnings related to vcodec operations.

Threat Intelligence Overview

EPSS Score
0.0%
Top 95% exploitable
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
Medium

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +39
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Use-after-free vulnerabilities occur when a program continues to access memory through a pointer after that memory has been deallocated.

Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

CVE-2024-20017 CRITICAL POC
9.8 Mar 04

In wlan service, there is a possible out of bounds write due to improper input validation. Rated critical severity (CVSS

CVE-2017-3216 CRITICAL POC
9.8 Jun 20

WiMAX routers based on the MediaTek SDK (libmtk) that use a custom httpd plugin are vulnerable to an authentication bypa

CVE-2019-15027 CRITICAL POC
9.8 Aug 14

The MediaTek Embedded Multimedia Card (eMMC) subsystem for Android on MT65xx, MT66xx, and MT8163 SoC devices allows atta

CVE-2016-6492 HIGH POC
7.8 Jan 12

The MT6573FDVT_SetRegHW function in camera_fdvt.c in the MediaTek driver for Linux allows local users to gain privileges

CVE-2023-32874 CRITICAL
9.8 Jan 02

In Modem IMS Stack, there is a possible out of bounds write due to a missing bounds check. Rated critical severity (CVSS

CVE-2025-20654 CRITICAL
9.8 Apr 07

In wlan service, there is a possible out of bounds write due to an incorrect bounds check. Rated critical severity (CVSS

CVE-2025-20646 CRITICAL
9.8 Mar 03

In wlan AP FW, there is a possible out of bounds write due to improper input validation. Rated critical severity (CVSS 9

CVE-2025-20672 CRITICAL
9.8 Jun 02

Heap OOB write in Android Bluetooth driver via incorrect bounds check.

CVE-2025-20674 CRITICAL
9.8 Jun 02

Remote privilege escalation in Android WLAN AP driver via packet injection.

CVE-2025-20684 CRITICAL
9.8 Jul 08

In wlan AP driver, there is a possible out of bounds write due to an incorrect bounds check. This could lead to local es

CVE-2025-20683 CRITICAL
9.8 Jul 08

In wlan AP driver, there is a possible out of bounds write due to an incorrect bounds check. This could lead to local es

CVE-2025-20682 CRITICAL
9.8 Jul 08

In wlan AP driver, there is a possible out of bounds write due to an incorrect bounds check. This could lead to local es

Vendor StatusVendor

SUSE

Severity: High
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise High Availability Extension 15 SP7 Fixed
SUSE Linux Enterprise High Availability Extension 15 SP7 Fixed
SUSE Linux Enterprise High Performance Computing 15 SP7 Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy