net: atlantic: fix the macsec key length
authorAntoine Tenart <atenart@kernel.org>
Thu, 24 Jun 2021 09:38:30 +0000 (11:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:28 +0000 (16:56 +0200)
commit9e753c47b905f068c4477387ff29a4c7124f3e97
tree5e6ecda8e4d29dba83c15652d8f18469105015bc
parent1c95d4d432c36902e81a854eddc26d6cb59e8e0e
net: atlantic: fix the macsec key length

[ Upstream commit d67fb4772d9a6cfd10f1109f0e7b1e6eb58c8e16 ]

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: 27736563ce32 ("net: atlantic: MACSec egress offload implementation")
Fixes: 9ff40a751a6f ("net: atlantic: MACSec ingress offload implementation")
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/ethernet/aquantia/atlantic/aq_macsec.h