Thread (4 messages) 4 messages, 3 authors, 2020-06-25

Re: [PATCH v2] net: phy: mscc: avoid skcipher API for single block AES encryption

From: David Miller <davem@davemloft.net>
Date: 2020-06-25 19:16:13
Also in: linux-crypto, stable

From: Ard Biesheuvel <ardb@kernel.org>
Date: Thu, 25 Jun 2020 09:18:16 +0200
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.

Fixes: 28c5107aa904e ("net: phy: mscc: macsec support")
Reviewed-by: Eric Biggers <redacted>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Applied and queued up for -stable, thanks.

Please never CC: stable for networking changes, I handle the submissions
by hand.

Thank you.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help