]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
macsec: limit replay window size with XPN
authorSabrina Dubroca <sd@queasysnail.net>
Fri, 22 Jul 2022 09:16:29 +0000 (11:16 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 16 Sep 2022 08:53:44 +0000 (10:53 +0200)
commit0b52e10a8ba8102c25cf570f7c5f817a16cde0d7
treecc67c2ad916a3deb1fd67a82a052c20f4d9930af
parent019866ee6fbd9b17580ab4ec03ef71fbbf2e8718
macsec: limit replay window size with XPN

BugLink: https://bugs.launchpad.net/bugs/1989218
[ Upstream commit b07a0e2044057f201d694ab474f5c42a02b6465b ]

IEEE 802.1AEbw-2013 (section 10.7.8) specifies that the maximum value
of the replay window is 2^30-1, to help with recovery of the upper
bits of the PN.

To avoid leaving the existing macsec device in an inconsistent state
if this test fails during changelink, reuse the cleanup mechanism
introduced for HW offload. This wasn't needed until now because
macsec_changelink_common could not fail during changelink, as
modifying the cipher suite was not allowed.

Finally, this must happen after handling IFLA_MACSEC_CIPHER_SUITE so
that secy->xpn is set.

Fixes: 48ef50fa866a ("macsec: Netlink support of XPN cipher suites (IEEE 802.1AEbw)")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/macsec.c