diff options
| author | Kyle Zeng <kylebot@openai.com> | 2026-10-29 21:22:37 -0700 |
|---|---|---|
| committer | Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb> | 2026-11-09 10:03:25 +0000 |
| commit | 1d5e2c57e9ffc134e14b3f837c8d7c53b508bd22 (patch) | |
| tree | 6c7fdf24a0dcb839caacb28ea2167748814420c3 /scripts/const_structs.checkpatch | |
| parent | 30c71476d842b094651bd7712f6c8ee8716147d0 (diff) | |
macsec: reject frames that decapsulate into runt Ethernet frames
When an SCI is unknown and the C bit is clear, macsec_handle_frame()
removes the SecTAG and the default ICV without checking how much of the
frame remains. A short frame can therefore become an skb shorter than
ETH_HLEN. eth_type_trans() cannot pull its Ethernet header, and a second
stacked MACsec device can copy stale skb headroom into a packet delivered
to a packet socket.
The matched-SCI path has a related hole: macsec_validate_skb() accepts a
short_length of one, so a frame that passes the existing length check can
still become a 13-byte Ethernet frame.
Require enough bytes for the MACsec overhead and a complete Ethernet
header before decapsulating an unknown-SCI frame. Apply the same bound
in macsec_validate_skb(), using the selected SecY's ICV length, to cover
the no-SA, synchronous-decrypt and asynchronous-decrypt delivery paths.
Leave other unknown-SCI handling unchanged.
Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver")
Cc: stable@vger.kernel.org
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Diffstat (limited to 'scripts/const_structs.checkpatch')
0 files changed, 0 insertions, 0 deletions
