macsec: fix replay protection at XPN lower-PN wrap
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ a21ecf0e033807b976967286e6c392f48ee2049f · < 6d00f5c7e5ff7ec4795b7f5f8ed88bd346641652| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
macsec: fix replay protection at XPN lower-PN wrap
In macsec_post_decrypt(), when pn is U32_MAX, pn + 1 overflows u32 to 0 and the first branch never fires. If next_pn_halves.lower is also in the upper half, pn_same_half(pn, lower) is true and the XPN else-if does not fire either, leaving next_pn_halves unchanged. An attacker that captures the legitimate frame carrying pn == 0xFFFFFFFF on an XPN association can then replay it indefinitely, since lowest_pn never rises above the captured pn and macsec_decrypt() reconstructs the same IV.
Extend the XPN else-if to also fire when pn + 1 wraps to 0, so receipt of pn == U32_MAX advances next_pn_halves to (upper + 1, 0).
From the CVE record · Linux
The Linux kernel's MACsec replay protection fails when the lower packet number wraps on an XPN association. An attacker who captures the legitimate frame with packet number 0xFFFFFFFF can replay it indefinitely. The input does not specify authentication or user-interaction requirements.
Engineers running Linux kernel MACsec with XPN associations should check their systems; affected versions were not provided.