CVE-2026-139493

wifi: mt76: fix wcid->pktid corruption in mt76_wcid_cleanup()

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

wifi: mt76: fix wcid->pktid corruption in mt76_wcid_cleanup()

mt76_wcid_cleanup() releases dev->status_lock before calling
idr_destroy(&wcid->pktid) to tear down the pktid idr. Meanwhile,
mt76_tx_status_skb_add() from tx.c can concurrently insert into
that same idr during tx completion handling:

spin_lock_bh(&dev->status_lock);

pid = idr_alloc(&wcid->pktid, skb, MT_PACKET_ID_FIRST,
MT_PACKET_ID_MASK, GFP_ATOMIC);

Since idr_destroy() runs outside the lock, it can execute concurrently
with idr_alloc() on the same idr, corrupting its internal data
structures. Because idr nodes are freed through the generic slab
allocator, this corruption can resurface later as an unrelated-looking
crash anywhere in the kernel that happens to reuse the same freed
memory.

Fix this by calling idr_destroy() before releasing dev->status_lock,
so that the table teardown and any concurrent insertion are mutually
exclusive.

Analysis

AI-generated

Technical impact

The race condition in the Linux kernel mt76 Wi‑Fi driver allows simultaneous idr_alloc and idr_destroy operations on the same idr data structure. Because idr_destroy() runs without holding the status lock, it can overlap with idr_alloc() during transmission completion handling, corrupting internal data structures. This corruption can later trigger kernel crashes that may surface as seemingly unrelated failures elsewhere in the system. The impact is a memory corruption that could lead to denial of service or, if an attacker can control the corrupted data, potential arbitrary code execution.

Affected Systems

Affected systems include all instances of the Linux kernel that ship with the mt76 Wi‑Fi driver prior to the patch commit. Any host running a kernel version that contains the buggy mt76_wcid_cleanup() implementation is vulnerable, regardless of distribution. No specific vendor or version range is listed, so all Linux kernel users using the mt76 driver should assume the vulnerability is present until patched.

Risk and Exploitability

No CVSS score is available and the EPSS score is not provided, but the lack of an exploitation record in CISA KEV suggests the issue is not immediately leveraged at scale. The attack requires the ability to trigger concurrent Tx completions that manipulate the idr table, likely via crafted wireless traffic or local misuse of the driver. While the vulnerability could be exploited by a local user with sufficient privileges or a network attacker on a compromised device, the primary risk is an unhandled kernel crash that could allow privilege escalation if exploited carefully. The applied fix restores proper lock ordering around idr_destroy(), eliminating the race and preventing memory corruption.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a version that includes the mt76 driver bug fix
  • For systems that cannot update the kernel, apply the patch changes from commit 158c1145fe7ddd82914011a00de7cc3262616b16 directly to the mt76 module sources and rebuild the module
  • Reboot the system to load the updated kernel or module, ensuring that the idr_destroy() operation is protected by the status lock

Generated by OpenCVE AI on November 30, 2026 at 23:26 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-367
CWE-395
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: wifi: mt76: fix wcid->pktid corruption in mt76_wcid_cleanup() mt76_wcid_cleanup() releases dev->status_lock before calling idr_destroy(&wcid->pktid) to tear down the pktid idr. Meanwhile, mt76_tx_status_skb_add() from tx.c can concurrently insert into that same idr during tx completion handling: spin_lock_bh(&dev->status_lock); pid = idr_alloc(&wcid->pktid, skb, MT_PACKET_ID_FIRST, MT_PACKET_ID_MASK, GFP_ATOMIC); Since idr_destroy() runs outside the lock, it can execute concurrently with idr_alloc() on the same idr, corrupting its internal data structures. Because idr nodes are freed through the generic slab allocator, this corruption can resurface later as an unrelated-looking crash anywhere in the kernel that happens to reuse the same freed memory. Fix this by calling idr_destroy() before releasing dev->status_lock, so that the table teardown and any concurrent insertion are mutually exclusive.
Title wifi: mt76: fix wcid->pktid corruption in mt76_wcid_cleanup()
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-367

    Time-of-check Time-of-use (TOCTOU) Race Condition

  • CWE-395

    Use of NullPointerException Catch to Detect NULL Pointer Dereference

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:35 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:19 PM
Modified
Nov 30, 2026, 2:19 PM