macsec: Fix header length if SCI is added if explicitly disabled
authorTobias Brunner <tobias@strongswan.org>
Mon, 24 Oct 2016 13:44:26 +0000 (15:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Nov 2016 06:48:53 +0000 (07:48 +0100)
commiteb77db88ea11e334816ceb5a537d775c1fc3fb72
treedd5ed4c7ab9f555795cd7043b4198c640c0f95a7
parent027ab3b8ee5a1dcb7d0f61175b3fb0d0a8afe0f0
macsec: Fix header length if SCI is added if explicitly disabled

[ Upstream commit e0f841f5cbf2a195c63f3441f3d8ef1cd2bdeeed ]

Even if sending SCIs is explicitly disabled, the code that creates the
Security Tag might still decide to add it (e.g. if multiple RX SCs are
defined on the MACsec interface).
But because the header length so far only depended on the configuration
option the SCI overwrote the original frame's contents (EtherType and
e.g. the beginning of the IP header) and if encrypted did not visibly
end up in the packet, while the SC flag in the TCI field of the Security
Tag was still set, resulting in invalid MACsec frames.

Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver")
Signed-off-by: Tobias Brunner <tobias@strongswan.org>
Acked-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/macsec.c