mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
crypto: aesni-intel - fix unaligned cbc decrypt for x86-32
commit 7c8d51848a
upstream.
The 32 bit variant of cbc(aes) decrypt is using instructions requiring
128 bit aligned memory locations but fails to ensure this constraint in
the code. Fix this by loading the data into intermediate registers with
load unaligned instructions.
This fixes reported general protection faults related to aesni.
References: https://bugzilla.kernel.org/show_bug.cgi?id=43223
Reported-by: Daniel <garkein@mailueberfall.de>
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
25ffc87a85
commit
cc62e8bf1f
1 changed files with 4 additions and 2 deletions
|
@ -2460,10 +2460,12 @@ ENTRY(aesni_cbc_dec)
|
|||
pxor IN3, STATE4
|
||||
movaps IN4, IV
|
||||
#else
|
||||
pxor (INP), STATE2
|
||||
pxor 0x10(INP), STATE3
|
||||
pxor IN1, STATE4
|
||||
movaps IN2, IV
|
||||
movups (INP), IN1
|
||||
pxor IN1, STATE2
|
||||
movups 0x10(INP), IN2
|
||||
pxor IN2, STATE3
|
||||
#endif
|
||||
movups STATE1, (OUTP)
|
||||
movups STATE2, 0x10(OUTP)
|
||||
|
|
Loading…
Reference in a new issue