linux/drivers/net/phy/mscc
Ard Biesheuvel 5a3235e50c net: phy: mscc: avoid skcipher API for single block AES encryption
The skcipher API dynamically instantiates the transformation object
on request that implements the requested algorithm optimally on the
given platform. This notion of optimality only matters for cases like
bulk network or disk encryption, where performance can be a bottleneck,
or in cases where the algorithm itself is not known at compile time.

In the mscc case, we are dealing with AES encryption of a single
block, and so neither concern applies, and we are better off using
the AES library interface, which is lightweight and safe for this
kind of use.

Note that the scatterlist API does not permit references to buffers
that are located on the stack, so the existing code is incorrect in
any case, but avoiding the skcipher and scatterlist APIs entirely is
the most straight-forward approach to fixing this.

Cc: Antoine Tenart <antoine.tenart@bootlin.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Fixes: 28c5107aa9 ("net: phy: mscc: macsec support")
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-06-25 12:16:14 -07:00
..
Makefile
mscc.h net: mscc: Fix OF_MDIO config check 2020-06-05 13:15:22 -07:00
mscc_fc_buffer.h net: phy: mscc: fix header defines and descriptions 2020-03-14 21:06:45 -07:00
mscc_mac.h net: phy: mscc: fix initialization of the MACsec protocol mode 2020-05-23 16:31:53 -07:00
mscc_macsec.c net: phy: mscc: avoid skcipher API for single block AES encryption 2020-06-25 12:16:14 -07:00
mscc_macsec.h net: phy: mscc: fix initialization of the MACsec protocol mode 2020-05-23 16:31:53 -07:00
mscc_main.c net: phy: mscc: fix Serdes configuration in vsc8584_config_init 2020-06-05 13:16:13 -07:00