CVE-2026-139344: macsec: prevent AES-GCM nonce reuse after packet number wrap
In the Linux kernel, the following vulnerability has been resolved:
macsec: prevent AES-GCM nonce reuse after packet number wrap
After allocating the last valid packet number, MACsec wraps nextpn to zero and deactivates the transmit SA. This happens for both 32- and 64-bit types of packet numbers (at values 0xffffffff and 0xffffffffffffffff, respectively).
TX packets that were still getting processed during deactivation keep being processed and then receive packet numbers. The first gets 0 and is correctly dropped, but nextpn is incremented to 1, which makes the next packet take number 1. It then does not get dropped and may induce a reuse of the AES-GCM nonce corresponding to value 1.
This race affects TX packets that have already passed the SA activity check: packets that observe the inactive SA are correctly dropped. Reactivating the SA after PN wrap without a packet number can also cause nonce reuse. Keep nextpn at 0 after wrap, even if the SA is reactivated, so further packet number allocations return 0 and the corresponding packets are dropped.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Keep next_pn at 0 after packet-number wrap, even if the transmit SA is reactivated, so packet-number allocations do not reuse nonce value 1.
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Systems using Linux kernel MACsec transmission security associations are exposed when a transmit SA reaches packet-number wrap. The race concerns TX packets that had already passed the SA activity check when the SA is deactivated.
What condition is required for nonce reuse to occur?
The transmit SA must allocate its last valid 32-bit or 64-bit packet number, then in-flight TX processing must continue through deactivation. After the first post-wrap packet is dropped at packet number 0, the vulnerable behavior can allow a subsequent packet to receive packet number 1 and reuse its AES-GCM nonce.
Can reactivating a transmit SA create the problem?
Yes. Reactivating an SA after packet-number wrap without a packet number can also permit nonce reuse under the vulnerable behavior.
How does the fix prevent exploitation after packet-number wrap?
The fix keeps next_pn at 0 after wrap, including if the SA is reactivated. Any further packet-number allocations therefore return 0 and the associated packets are dropped.