CVE Professor
/
All CVEs
CVE-2026-139099

CVE-2026-139099 — Linux Kernel — NONE Vulnerability

NONE CVSS 0 ⚡ EPSS 0.2% NVD+CVE.org

In the Linux kernel, the following vulnerability has been resolved: net: bgmac: fix TX DMA unmapping and slot cleanup When mapping a fragment fails, bgmac_dma_tx_add() unwinds with the wrong slots. It passes the failed fragment's slot->dma_addr, which holds the mapping error, to dma_unmap_single() for the head. The fragment loop indexes from ring->end instead of ring->end + 1, so it unmaps the head a second time as a page and leaves the last mapped fragment mapped. None of the affected slots get their dma_addr cleared either, which includes the head slot when mapping the head fails. bgmac_dma_tx_ring_free() unmaps every slot with a non-zero dma_addr, so tearing down the ring unmaps these addresses again. It also frees the skbs of pending TX slots but leaves slot->skb and slot->dma_addr set. The slots survive a down/up cycle, and bgmac_dma_tx_add() only sets slot->skb on the last slot of a packet. If a slot with a stale pointer is later used for the head or a fragment of a scatter/gather packet, bgmac_dma_tx_free() frees the old skb a second time when that slot completes. bgmac_dma_tx_ring_free() also picks dma_unmap_single() or dma_unmap_page() by looking at slot->skb, which is set on the last slot of a packet, while the head was mapped with dma_map_single() and the fragments with skb_frag_dma_map(). In the error path, unmap the head and each mapped fragment from their own slots, and clear dma_addr on every slot the failed packet touched. In bgmac_dma_tx_ring_free(), choose the unmap function by the SOF flag of the descriptor like bgmac_dma_tx_free() does, unmap every slot before freeing any skb, since a packet can wrap around the end of the ring with its skb on the last slot, and clear both fields. This was found through code inspection by an LLM while hitting other bugs on an Asus RT-N16. It did not hit these ones specifically.

In the Linux kernel, the following vulnerability has been resolved: net: bgmac: fix TX DMA unmapping and slot cleanup When mapping a fragment fails, bgmac_dma_tx_add() unwinds with the wrong slots. It passes the failed fragment's slot->dma_addr, which holds the mapping error, to dma_unmap_single() for the head. The fragment loop indexes from ring->end instead of ring->end + 1, so it unmaps the head a second time as a page and leaves the last mapped fragment mapped. None of the affected slots get their dma_addr cleared either, which includes the head slot when mapping the head fails. bgmac_dma_tx_ring_free() unmaps every slot with a non-zero dma_addr, so tearing down the ring unmaps these addresses again. It also frees the skbs of pending TX slots but leaves slot->skb and slot->dma_addr set. The slots survive a down/up cycle, and bgmac_dma_tx_add() only sets slot->skb on the last slot of a packet. If a slot with a stale pointer is later used for the head or a fragment of a scatter/gather packet, bgmac_dma_tx_free() frees the old skb a second time when that slot completes. bgmac_dma_tx_ring_free() also picks dma_unmap_single() or dma_unmap_page() by looking at slot->skb, which is set on the last slot of a packet, while the head was mapped with dma_map_single() and the fragments with skb_frag_dma_map(). In the error path, unmap the head and each mapped fragment from their own slots, and clear dma_addr on every slot the failed packet touched. In bgmac_dma_tx_ring_free(), choose the unmap function by the SOF flag of the descriptor like bgmac_dma_tx_free() does, unmap every slot before freeing any skb, since a packet can wrap around the end of the ring with its skb on the last slot, and clear both fields. This was found through code inspection by an LLM while hitting other bugs on an Asus RT-N16. It did not hit these ones specifically.

EPSS — Exploit Prediction Scoring System
0.2%
30-day probability
In the 13. percentile of all CVEs — higher exploitation probability than most vulnerabilities.
AI Security Analysis & Remediation

🎯 What is this vulnerability?

This vulnerability is a complex Use-After-Free (UAF) and Double Free bug located in the bgmac (Broadcom BCM53xx) Ethernet driver within the Linux kernel. It specifically affects the Transmission (TX) DMA ring buffer management logic.

The core technical flaws are:

1. Incorrect DMA Unmapping in Error Path: When bgmac_dma_tx_add() fails to map a network fragment (scatter/gather packet), the error handling code incorrectly calls dma_unmap_single() on the head slot using the error address from the failed fragment. Furthermore, the loop that unmaps previously mapped fragments starts at the wrong index (ring->end instead of ring->end + 1), causing the head packet to be unmapped twice (once as a single buffer, once as a page) and leaving the last successfully mapped fragment mapped. Crucially, the dma_addr fields in the ring slots are not cleared after these failed operations.
2. Stale Pointer/Address Cleanup Failure: bgmac_dma_tx_ring_free() (called during device teardown or ring reset) unmaps any slot with a non-zero dma_addr. Because the error path failed to clear dma_addr, this function will attempt to unmap addresses that were already unmapped (or never validly mapped), leading to DMA mapping corruption.
3. Double Free of SKB: The ring slots retain stale skb pointers after bgmac_dma_tx_ring_free() frees the socket buffers but fails to set slot->skb to NULL. If the ring is reused (e.g., after a link down/up cycle), and a new packet is transmitted using a slot that still holds a stale skb pointer, bgmac_dma_tx_free() will attempt to free the old skb again when the new transmission completes. This results in a Double Free of the socket buffer.
4. Incorrect Unmap Function Selection: bgmac_dma_tx_ring_free() selects between dma_unmap_single() and dma_unmap_page() based on the presence of an skb in the slot. However, the head of a packet is always mapped with dma_map_single(), while fragments are mapped with skb_frag_dma_map() (which may use page mapping). The logic incorrectly assumes the last slot (which holds the skb) dictates the unmap type for all slots, leading to mismatched DMA unmap calls.

CWE Classification:

  • CWE-416: Use After Free (Stale skb pointer leading to double free)

  • CWE-415: Double Free (Explicit double free of skb)

  • CWE-665: Improper Initialization (Failure to clear dma_addr and skb pointers in error paths)
  • CVSS Note: The provided CVSS score is 0/10 (NONE). This is highly unusual for a kernel memory corruption bug. It likely indicates that the NVD or the source of this data has not yet assigned a proper score, or it is classified as "None" due to the specific context (e.g., requiring physical access or specific hardware not widely deployed in critical infrastructure). However, from a technical standpoint, a kernel double-free/UAF is typically rated High or Critical if exploitable.

    ⚡ Attack Chain

    Important Context: The bgmac driver is used in embedded Broadcom-based devices (e.g., Asus RT-N16, various IoT routers, industrial controllers). Exploitation requires the ability to trigger the specific error path in bgmac_dma_tx_add() and then reuse the ring buffer.

    1. Discovery & Reconnaissance

  • Target Identification: Identify devices running Linux with the bgmac driver loaded.
  • * Command: lspci | grep -i eth or dmesg | grep bgmac * Common devices: Asus RT-N16, RT-N14U, and other Broadcom BCM53xx-based routers.
  • Version Check: Determine the kernel version. The fix is in the bgmac driver. Check uname -r.
  • Prerequisites: The attacker needs the ability to send network traffic that triggers a DMA mapping failure. This could be achieved by:
  • * Sending malformed or oversized packets that cause the driver to attempt to map fragments that fail (e.g., due to memory pressure or specific hardware limitations). * Triggering a link down/up cycle to force bgmac_dma_tx_ring_free() to be called while stale pointers exist.

    2. Exploitation

    The exploitation is complex and requires precise timing and state manipulation. A realistic PoC would involve:

    1. Triggering the Error Path:
    * Craft a scatter/gather packet (multiple fragments) where the mapping of a subsequent fragment fails. This can be simulated by exhausting DMA memory or sending a packet with a fragment that the hardware cannot map (e.g., non-contiguous physical memory that the DMA engine rejects).
    * This causes bgmac_dma_tx_add() to enter the error path, leaving dma_addr set in slots and skb pointers stale.

    2. Forcing Ring Reuse:
    * Trigger a link down/up cycle (e.g., by unplugging/replugging the Ethernet cable or using ip link set eth0 down/up).
    * This calls bgmac_dma_tx_ring_free(), which unmaps the stale dma_addr values (causing DMA corruption) but leaves slot->skb pointers intact.

    3. Triggering Double Free:
    * Send a new packet that uses the same ring slots.
    * When the new packet completes transmission, bgmac_dma_tx_free() is called.
    * It sees the stale skb pointer in the slot and attempts to free it again, resulting in a Double Free.

    Illustrative PoC (Conceptual):

    # 1. Identify the interface
    IFACE="eth0"
    
    # 2. Trigger DMA mapping failure (requires specific conditions, e.g., memory pressure)
    # This is highly dependent on the specific hardware and kernel configuration.
    # A common method is to send a large number of fragmented packets rapidly.
    for i in {1..10000}; do
        # Send a packet with multiple fragments (e.g., using scapy or a custom tool)
        # This is illustrative; actual payload depends on the driver's fragment handling.
        python3 -c "
        from scapy.all import *
        pkt = Ether()/IP()/UDP()/Raw(load=b'A'*1000)
        sendp(pkt, iface='$IFACE', count=1)
        "
    done
    
    # 3. Trigger ring reset
    ip link set $IFACE down
    ip link set $IFACE up
    
    # 4. Send a new packet to trigger the double free
    python3 -c "
    from scapy.all import *
    pkt = Ether()/IP()/UDP()/Raw(load=b'B'*100)
    sendp(pkt, iface='$IFACE', count=1)
    "

    Note: This PoC is illustrative and may not work on all systems. The actual trigger for the DMA mapping failure is hardware-specific and may require more sophisticated manipulation (e.g., using mmap to create non-contiguous memory regions or exploiting specific DMA engine limitations).

    3. Post-Exploitation

  • Kernel Crash (Denial of Service): The most likely outcome is a kernel panic or oops due to the double free or DMA corruption. This leads to a Denial of Service (DoS).
  • Privilege Escalation: If the double free can be controlled (e.g., by spraying heap objects to control the freed memory), it may be possible to achieve Arbitrary Code Execution (ACE) in kernel context. This would allow the attacker to:
  • * Bypass security mechanisms (e.g., SELinux, AppArmor). * Create a root shell. * Exfiltrate sensitive data (e.g., network credentials, SSH keys).

    🌍 Real World Impact

  • Confidentiality: High (if ACE is achieved). Kernel-level code execution allows access to all memory, including network credentials, encryption keys, and user data.
  • Integrity: High (if ACE is achieved). The attacker can modify kernel data structures, inject malicious code, or alter network traffic.
  • Availability: High. A kernel panic or oops will crash the device, causing a complete loss of service. Even without ACE, the DMA corruption can lead to system instability or crashes.
  • Practical Consequences:

  • IoT/Router Devices: Many embedded devices using Broadcom chips (e.g., Asus RT-N16) are vulnerable. A remote attacker with network access could potentially crash the router, causing a DoS. If ACE is possible, the attacker could take over the router, redirect traffic, or use it as a pivot point for further attacks.

  • Industrial Control Systems (ICS): If bgmac is used in ICS devices, a crash could have significant operational and safety implications.
  • 🛡️ Remediation & Mitigation

    Exact Affected Versions

  • Affected: Linux kernels with the bgmac driver prior to the commit that fixes the TX DMA unmapping and slot cleanup.
  • Fixed: The fix is included in the Linux kernel commit that addresses "net: bgmac: fix TX DMA unmapping and slot cleanup". Check your kernel changelog for this specific commit.
  • Upgrade Recommendation

  • Upgrade the Linux kernel to a version that includes the fix. For embedded devices, check the vendor's security advisories for updated firmware.
  • Asus RT-N16: Check for firmware updates from Asus that include the latest Linux kernel.
  • Actionable Workarounds

    1. Disable the bgmac Driver (if possible): * If the device has an alternative network interface (e.g., USB Ethernet), disable the bgmac interface. * Command: ip link set eth0 down 2. Restrict Network Access: * Limit access to the vulnerable interface to trusted networks only. * Use firewall rules to block untrusted traffic from reaching the device. 3. Monitor for Crashes: * Enable kernel logging and monitor for oops or panic messages related to bgmac or DMA.

    Detection

  • Kernel Logs: Look for messages like:
  • * BUG: KASAN: double-free in bgmac_dma_tx_free * DMA-API: device driver has busy DMA memory * Kernel panic - not syncing: Fatal exception
  • Network Traffic: Monitor for unusual patterns of fragmented packets or link down/up cycles that could be used to trigger the vulnerability.
  • ⚠️ Urgency

    CVSS Score: 0/10 (NONE) – Note: This is likely a placeholder or error. A kernel double-free/UAF is typically rated High or Critical.*

  • CISA KEV: No

  • Exploit Complexity: High (requires specific hardware and precise timing)

  • Patching Priority: Medium to High

* If the device is internet-facing or in a critical infrastructure role, patch immediately.
* If the device is isolated, patch during the next maintenance window.
* Given the potential for ACE, treat this as a high-priority issue for any device using the bgmac driver.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="Linux Linux"
CVSS Score
0 / 10 · CVSS NONE
Affected Products (2)
Linux Kernel (commit: 88979640f4) Linux Kernel (4.1)
Related CVEs
9.4
CVE-2026-129109
Calico installations managed by the Tigera Operator install a FlexVolume driver (nodeagent~uds/uds) on every L
8.8
CVE-2026-105101
An OS command injection vulnerability in the ping diagnostic function (InternetState.java) in Elinktek UZ801 4
8.8
CVE-2026-118966
A missing authentication vulnerability in the SSH server of Nokia SR Linux allows an unauthenticated attacker
8.7
CVE-2026-145182
Mullvad gotatun 0.1.0 before 0.10.1 contains a denial of service vulnerability that allows unauthenticated rem
0.0
CVE-2026-132063
The 2C2P Redirect API for WooCommerce WordPress plugin through 7.0.3 does not stop processing a payment callba
0.0
CVE-2026-140849
Multiple malformed-packet handling vulnerabilities exist in a number of Nokia SR OS control-plane protocols (B
0.0
CVE-2026-141072
Rejected reason: Not a valid vulnerability.