From: "Séguier Régis" <rseguier@e-teleport.net>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org
Subject: Re: Padlock SHA1 failed at boot time
Date: Mon, 21 Sep 2009 09:49:52 +0200 [thread overview]
Message-ID: <4AB73020.1050403@e-teleport.net> (raw)
In-Reply-To: <20090921061324.GA16944@gondor.apana.org.au>
Herbert Xu a écrit :
> Séguier Régis <rseguier@e-teleport.net> wrote:
>
>> Hi,
>>
>> With 2.6.31, at boot time,i got this error.
>> The previous version i use was 2.6.31-rc6 and work fine for me.
>>
>> cpuidle: using governor menu
>> padlock: Using VIA PadLock ACE for AES algorithm.
>> general protection fault: 0000 [#1] PREEMPT
>> last sysfs file:
>>
>> Pid: 83, comm: cryptomgr_test Not tainted (2.6.31EPIA_NAB7500 #311)
>> CN896-8251
>> EIP: 0060:[<c1247ef5>] EFLAGS: 00010202 CPU: 0
>> EIP is at padlock_sha1_finup+0x1a2/0x1f3
>> EAX: 00000000 EBX: 00000003 ECX: 00000003 EDX: 00000001
>> ESI: f734f000 EDI: f7367c88 EBP: f7367d18 ESP: f7367c18
>>
>
> This looks like an alignment fault.
>
> Can you please try this patch? Thanks!
>
> diff --git a/drivers/crypto/padlock-sha.c b/drivers/crypto/padlock-sha.c
> index 76cb6b3..fe007b6 100644
> --- a/drivers/crypto/padlock-sha.c
> +++ b/drivers/crypto/padlock-sha.c
> @@ -24,6 +24,12 @@
> #include <asm/i387.h>
> #include "padlock.h"
>
> +#ifdef CONFIG_64BIT
> +#define STACK_ALIGN 16
> +#else
> +#define STACK_ALIGN 4
> +#endif
> +
> struct padlock_sha_desc {
> struct shash_desc fallback;
> };
> @@ -64,7 +70,8 @@ static int padlock_sha1_finup(struct shash_desc *desc, const u8 *in,
> /* We can't store directly to *out as it may be unaligned. */
> /* BTW Don't reduce the buffer size below 128 Bytes!
> * PadLock microcode needs it that big. */
> - char result[128] __attribute__ ((aligned(PADLOCK_ALIGNMENT)));
> + char buf[128 + PADLOCK_ALIGNMENT - STACK_ALIGN];
> + char *result = PTR_ALIGN(&buf[0], PADLOCK_ALIGNMENT);
> struct padlock_sha_desc *dctx = shash_desc_ctx(desc);
> struct sha1_state state;
> unsigned int space;
> @@ -128,7 +135,8 @@ static int padlock_sha256_finup(struct shash_desc *desc, const u8 *in,
> /* We can't store directly to *out as it may be unaligned. */
> /* BTW Don't reduce the buffer size below 128 Bytes!
> * PadLock microcode needs it that big. */
> - char result[128] __attribute__ ((aligned(PADLOCK_ALIGNMENT)));
> + char buf[128 + PADLOCK_ALIGNMENT - STACK_ALIGN];
> + char *result = PTR_ALIGN(&buf[0], PADLOCK_ALIGNMENT);
> struct padlock_sha_desc *dctx = shash_desc_ctx(desc);
> struct sha256_state state;
> unsigned int space;
>
>
it's good for me now.
Thanks.
--
Régis Séguier
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-09-21 7:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-20 16:23 Padlock SHA1 failed at boot time Séguier Régis
2009-09-21 6:13 ` Herbert Xu
2009-09-21 7:49 ` Séguier Régis [this message]
2009-09-22 1:56 ` Herbert Xu
2009-09-22 17:17 ` Herbert Xu
2009-09-22 17:34 ` Séguier Régis
2009-09-23 5:27 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AB73020.1050403@e-teleport.net \
--to=rseguier@e-teleport.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=technique@e-teleport.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox