]> git.baikalelectronics.ru Git - kernel.git/commit
net: macsec: Verify that send_sci is on when setting Tx sci explicitly
authorLior Nahmanson <liorna@nvidia.com>
Sun, 30 Jan 2022 11:37:52 +0000 (13:37 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 2 Feb 2022 04:32:20 +0000 (20:32 -0800)
commit0258a8bb98a92a0b3059d835cae4f34ab3a1f6d1
tree1c5a70fb52d17d7eb526fe1ce0c5b23c8e3a69c3
parent7cf6fe163bf54abb17796c0fde026ac60161f4d2
net: macsec: Verify that send_sci is on when setting Tx sci explicitly

When setting Tx sci explicit, the Rx side is expected to use this
sci and not recalculate it from the packet.However, in case of Tx sci
is explicit and send_sci is off, the receiver is wrongly recalculate
the sci from the source MAC address which most likely be different
than the explicit sci.

Fix by preventing such configuration when macsec newlink is established
and return EINVAL error code on such cases.

Fixes: 4453af01ee3c ("macsec: introduce IEEE 802.1AE driver")
Signed-off-by: Lior Nahmanson <liorna@nvidia.com>
Reviewed-by: Raed Salem <raeds@nvidia.com>
Signed-off-by: Raed Salem <raeds@nvidia.com>
Link: https://lore.kernel.org/r/1643542672-29403-1-git-send-email-raeds@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/macsec.c