Skip to content
Commit 46d8c4b2 authored by Herbert Xu's avatar Herbert Xu
Browse files

crypto: padlock-aes - Fix Nano workaround data corruption



This was detected by the self-test thanks to Ard's chunking patch.

I finally got around to testing this out on my ancient Via box.  It
turns out that the workaround got the assembly wrong and we end up
doing count + initial cycles of the loop instead of just count.

This obviously causes corruption, either by overwriting the source
that is yet to be processed, or writing over the end of the buffer.

On CPUs that don't require the workaround only ECB is affected.
On Nano CPUs both ECB and CBC are affected.

This patch fixes it by doing the subtraction prior to the assembly.

Fixes: a76c1c23 ("crypto: padlock-aes - work around Nano CPU...")
Cc: <stable@vger.kernel.org>
Reported-by: default avatarJamie Heilman <jamie@audible.transient.net>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 2546da99
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment