mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
net: macsec: fix the length used to copy the key for offloading
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: 3cf3227a21
("net: macsec: hardware offloading infrastructure")
Reported-by: Lior Nahmanson <liorna@nvidia.com>
Signed-off-by: Antoine Tenart <atenart@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
abe90454f0
commit
1f7fe51211
2 changed files with 3 additions and 3 deletions
|
@ -241,7 +241,7 @@ struct macsec_context {
|
|||
struct macsec_rx_sc *rx_sc;
|
||||
struct {
|
||||
unsigned char assoc_num;
|
||||
u8 key[MACSEC_KEYID_LEN];
|
||||
u8 key[MACSEC_MAX_KEY_LEN];
|
||||
union {
|
||||
struct macsec_rx_sa *rx_sa;
|
||||
struct macsec_tx_sa *tx_sa;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue