From: Antoine Tenart <atenart@kernel.org> Date: 2021-06-24 09:38:35
Hello,
The key length used to copy the key to offloading drivers and to store
it is wrong and was working by chance as it matched the default key
length. But using a different key length fails. Fix it by using instead
the max length accepted in uAPI to store the key and the actual key
length when copying it.
This was tested on the MSCC PHY driver but not on the Atlantic MAC
(looking at the code it looks ok, but testing would be appreciated).
Thanks,
Antoine
Antoine Tenart (3):
net: macsec: fix the length used to copy the key for offloading
net: phy: mscc: fix macsec key length
net: atlantic: fix the macsec key length
drivers/net/ethernet/aquantia/atlantic/aq_macsec.h | 4 ++--
drivers/net/macsec.c | 4 ++--
drivers/net/phy/mscc/mscc_macsec.c | 2 +-
drivers/net/phy/mscc/mscc_macsec.h | 2 +-
include/net/macsec.h | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
--
2.31.1
From: Antoine Tenart <atenart@kernel.org> Date: 2021-06-24 09:38:37
The key length used when offloading macsec to Ethernet or PHY drivers
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 to store the key (the max length
accepted in uAPI) and secy->key_len to copy it.
Fixes: 3cf3227a21d1 ("net: macsec: hardware offloading infrastructure")
Reported-by: Lior Nahmanson <redacted>
Signed-off-by: Antoine Tenart <atenart@kernel.org>
---
drivers/net/macsec.c | 4 ++--
include/net/macsec.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
From: Antoine Tenart <atenart@kernel.org> Date: 2021-06-24 09:38:43
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 <redacted>
Signed-off-by: Antoine Tenart <atenart@kernel.org>
---
drivers/net/phy/mscc/mscc_macsec.c | 2 +-
drivers/net/phy/mscc/mscc_macsec.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
@@ -501,7 +501,7 @@ static u32 vsc8584_macsec_flow_context_id(struct macsec_flow *flow)}/* Derive the AES key to get a key for the hash autentication */-staticintvsc8584_macsec_derive_key(constu8key[MACSEC_KEYID_LEN],+staticintvsc8584_macsec_derive_key(constu8key[MACSEC_MAX_KEY_LEN],u16key_len,u8hkey[16]){constu8input[AES_BLOCK_SIZE]={0};
From: Antoine Tenart <atenart@kernel.org> Date: 2021-06-24 09:38:45
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 <redacted>
Signed-off-by: Antoine Tenart <atenart@kernel.org>
---
drivers/net/ethernet/aquantia/atlantic/aq_macsec.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Hello:
This series was applied to netdev/net.git (refs/heads/master):
On Thu, 24 Jun 2021 11:38:27 +0200 you wrote:
Hello,
The key length used to copy the key to offloading drivers and to store
it is wrong and was working by chance as it matched the default key
length. But using a different key length fails. Fix it by using instead
the max length accepted in uAPI to store the key and the actual key
length when copying it.
[...]