CVE-2026-139099: net: bgmac: fix TX DMA unmapping and slot cleanup

Published Nov 30, 2026
·
Updated

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

net: bgmac: fix TX DMA unmapping and slot cleanup

When mapping a fragment fails, bgmacdmatxadd() unwinds with the wrong slots. It passes the failed fragment's slot->dmaaddr, which holds the mapping error, to dmaunmapsingle() 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 dmaaddr cleared either, which includes the head slot when mapping the head fails.

bgmacdmatxringfree() unmaps every slot with a non-zero dmaaddr, so tearing down the ring unmaps these addresses again. It also frees the skbs of pending TX slots but leaves slot->skb and slot->dmaaddr set. The slots survive a down/up cycle, and bgmacdmatxadd() 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, bgmacdmatxfree() frees the old skb a second time when that slot completes.

bgmacdmatxringfree() also picks dmaunmapsingle() or dmaunmappage() by looking at slot->skb, which is set on the last slot of a packet, while the head was mapped with dmamapsingle() and the fragments with skbfragdmamap().

In the error path, unmap the head and each mapped fragment from their own slots, and clear dmaaddr on every slot the failed packet touched. In bgmacdmatxringfree(), choose the unmap function by the SOF flag of the descriptor like bgmacdmatxfree() 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.

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    In bgmac_dma_tx_ring_free(), choose dma_unmap_single() or dma_unmap_page() using the SOF flag. In the mapping-error path, unmap the head and each mapped fragment with the matching unmap function, process fragment slots starting at ring->end + 1, and clear dma_addr and skb on every slot touched. When freeing pending TX slots, clear both fields.

Event History

Nov 30, 2026
CVE Published
via MITRE·01:31 PM
Data Sourced
via MITRE·01:31 PM
Description

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203