]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: mscc: fix macsec key length
authorAntoine Tenart <atenart@kernel.org>
Thu, 24 Jun 2021 09:38:29 +0000 (11:38 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Jun 2021 19:41:12 +0000 (12:41 -0700)
commiteddcb4d2caea3514d9cc504f6eb6396d26693dcc
treea801e4b22f45d4e7a4da5c50bfecc224ea2fed55
parentb72a5a2fb0d8e3ae6355c8766bb49ddb9d5a8cda
net: phy: mscc: fix macsec key length

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: f999521bdebb ("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>
drivers/net/phy/mscc/mscc_macsec.c
drivers/net/phy/mscc/mscc_macsec.h