summaryrefslogtreecommitdiff
path: root/drivers/crypto
diff options
context:
space:
mode:
authorMichal Ludvig <michal@logix.cz>2006-07-15 05:08:50 +0400
committerHerbert Xu <herbert@gondor.apana.org.au>2006-07-15 05:08:50 +0400
commitcc08632f8f26d479500f8107c84e206770cb901c (patch)
treebd1cdf141a816571dda1ffcea130875f66e48e63 /drivers/crypto
parentab6cf0d0cb96417ef65cc2c2120c0e879edf7a4a (diff)
downloadlinux-cc08632f8f26d479500f8107c84e206770cb901c.tar.xz
[CRYPTO] padlock: Fix alignment after aes_ctx rearrange
Herbert's patch 82062c72cd643c99a9e1c231270acbab986fd23f 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: Michal Ludvig <michal@logix.cz> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/padlock-aes.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c
index 17ee684144f9..b643d71298a9 100644
--- a/drivers/crypto/padlock-aes.c
+++ b/drivers/crypto/padlock-aes.c
@@ -59,6 +59,9 @@
#define AES_EXTENDED_KEY_SIZE 64 /* in uint32_t units */
#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 {
struct cword encrypt;
@@ -66,8 +69,10 @@ struct aes_ctx {
} cword;
u32 *D;
int key_length;
- u32 E[AES_EXTENDED_KEY_SIZE];
- u32 d_data[AES_EXTENDED_KEY_SIZE];
+ u32 E[AES_EXTENDED_KEY_SIZE]
+ __attribute__ ((__aligned__(PADLOCK_ALIGNMENT)));
+ u32 d_data[AES_EXTENDED_KEY_SIZE]
+ __attribute__ ((__aligned__(PADLOCK_ALIGNMENT)));
};
/* ====== Key management routines ====== */