Commit cc08632f authored by Michal Ludvig's avatar Michal Ludvig Committed by Herbert Xu

[CRYPTO] padlock: Fix alignment after aes_ctx rearrange

Herbert's patch 82062c72 
in cryptodev-2.6 tree breaks alignment rules for PadLock 
xcrypt instruction leading to General protection Oopses.

This patch fixes the problem.
Signed-off-by: default avatarMichal Ludvig <michal@logix.cz>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent ab6cf0d0
...@@ -59,6 +59,9 @@ ...@@ -59,6 +59,9 @@
#define AES_EXTENDED_KEY_SIZE 64 /* in uint32_t units */ #define AES_EXTENDED_KEY_SIZE 64 /* in uint32_t units */
#define AES_EXTENDED_KEY_SIZE_B (AES_EXTENDED_KEY_SIZE * sizeof(uint32_t)) #define AES_EXTENDED_KEY_SIZE_B (AES_EXTENDED_KEY_SIZE * sizeof(uint32_t))
/* Whenever making any changes to the following
* structure *make sure* you keep E, d_data
* and cword aligned on 16 Bytes boundaries!!! */
struct aes_ctx { struct aes_ctx {
struct { struct {
struct cword encrypt; struct cword encrypt;
...@@ -66,8 +69,10 @@ struct aes_ctx { ...@@ -66,8 +69,10 @@ struct aes_ctx {
} cword; } cword;
u32 *D; u32 *D;
int key_length; int key_length;
u32 E[AES_EXTENDED_KEY_SIZE]; u32 E[AES_EXTENDED_KEY_SIZE]
u32 d_data[AES_EXTENDED_KEY_SIZE]; __attribute__ ((__aligned__(PADLOCK_ALIGNMENT)));
u32 d_data[AES_EXTENDED_KEY_SIZE]
__attribute__ ((__aligned__(PADLOCK_ALIGNMENT)));
}; };
/* ====== Key management routines ====== */ /* ====== Key management routines ====== */
......
Markdown is supported
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