Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: mscc: macsec: reject PN update requests

Updating the PN is not supported.
Return -EINVAL if update_pn is true.

The following command succeeded, but it should fail because the driver
does not update the PN:
ip macsec set macsec0 tx sa 0 pn 232 on

Fixes: 28c5107aa904 ("net: phy: mscc: macsec support")
Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Radu Pirea (NXP OSS) and committed by
Paolo Abeni
e0a8c918 4dcf38ae

+6
+6
drivers/net/phy/mscc/mscc_macsec.c
··· 849 849 struct macsec_flow *flow; 850 850 int ret; 851 851 852 + if (ctx->sa.update_pn) 853 + return -EINVAL; 854 + 852 855 flow = vsc8584_macsec_find_flow(ctx, MACSEC_INGR); 853 856 if (IS_ERR(flow)) 854 857 return PTR_ERR(flow); ··· 902 899 { 903 900 struct macsec_flow *flow; 904 901 int ret; 902 + 903 + if (ctx->sa.update_pn) 904 + return -EINVAL; 905 905 906 906 flow = vsc8584_macsec_find_flow(ctx, MACSEC_EGR); 907 907 if (IS_ERR(flow))