net: phy: mscc: fix macsec key length
authorAntoine Tenart <atenart@kernel.org>
Thu, 24 Jun 2021 09:38:29 +0000 (11:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 15:07:19 +0000 (17:07 +0200)
commitd22eadd94ca5a50e8f1acbc54bc72af456b00ec4
treec4cce8de685e5d44194c2b719612e4a4cb893825
parent70521208f6ce38ed82c8f27b35389d41582e831c
net: phy: mscc: fix macsec key length

[ Upstream commit c309217f91f2d2097c2a0a832d9bff50b88c81dc ]

The key length used to store the macsec key was set to MACSEC_KEYID_LEN
(16), which is an issue as:
- This was never meant to be the key length.
- The key length can be > 16.

Fix this by using MACSEC_MAX_KEY_LEN instead (the max length accepted in
uAPI).

Fixes: 28c5107aa904 ("net: phy: mscc: macsec support")
Reported-by: Lior Nahmanson <liorna@nvidia.com>
Signed-off-by: Antoine Tenart <atenart@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/phy/mscc/mscc_macsec.c
drivers/net/phy/mscc/mscc_macsec.h