]> git.baikalelectronics.ru Git - 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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Jul 2022 10:49:25 +0000 (11:49 +0100)
commiteef13ddd2e9f7372e43a26bb1044c8fc29019afb
treed6f26638c9c41443a224b7513fd2e59317af46c5
parent89676dbfcf94c0ecc8e445552ea39db975117aae
macsec: limit replay window size with XPN

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: bb178617ead6 ("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>
drivers/net/macsec.c