From: Julian Wollrath <jwollrath@web.de>
To: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Cc: linux-crypto@vger.kernel.org,
Tim Chen <tim.c.chen@linux.intel.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] crypto: sha256_ssse3 - fix stack corruption with SSSE3 and AVX implementations
Date: Wed, 22 May 2013 16:51:24 +0200 [thread overview]
Message-ID: <20130522165124.01696465@ilfaris> (raw)
In-Reply-To: <20130521140941.15997.83258.stgit@localhost6.localdomain6>
Hi,
> The _XFER stack element size was set too small, 8 bytes, when it
> needs to be 16 bytes. As _XFER is the last stack element used by
> these implementations, the 16 byte stores with 'movdqa' corrupt the
> stack where the value of register %r12 is temporarily stored. As
> these implementations align the stack pointer to 16 bytes, this
> corruption did not happen every time.
>
> Patch corrects this issue.
>
> Reported-by: Julian Wollrath <jwollrath@web.de>
> Cc: Tim Chen <tim.c.chen@linux.intel.com>
> Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Tested-by: Julian Wollrath <jwollrath@web.de>
Thank you for fixing this issue.
Best regards,
Julian Wollrath
> ---
> arch/x86/crypto/sha256-avx-asm.S | 2 +-
> arch/x86/crypto/sha256-ssse3-asm.S | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/crypto/sha256-avx-asm.S
> b/arch/x86/crypto/sha256-avx-asm.S index 56610c4..642f156 100644
> --- a/arch/x86/crypto/sha256-avx-asm.S
> +++ b/arch/x86/crypto/sha256-avx-asm.S
> @@ -118,7 +118,7 @@ y2 = %r15d
>
> _INP_END_SIZE = 8
> _INP_SIZE = 8
> -_XFER_SIZE = 8
> +_XFER_SIZE = 16
> _XMM_SAVE_SIZE = 0
>
> _INP_END = 0
> diff --git a/arch/x86/crypto/sha256-ssse3-asm.S
> b/arch/x86/crypto/sha256-ssse3-asm.S index 98d3c39..f833b74 100644
> --- a/arch/x86/crypto/sha256-ssse3-asm.S
> +++ b/arch/x86/crypto/sha256-ssse3-asm.S
> @@ -111,7 +111,7 @@ y2 = %r15d
>
> _INP_END_SIZE = 8
> _INP_SIZE = 8
> -_XFER_SIZE = 8
> +_XFER_SIZE = 16
> _XMM_SAVE_SIZE = 0
>
> _INP_END = 0
>
next prev parent reply other threads:[~2013-05-22 14:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-21 14:09 [PATCH] crypto: sha256_ssse3 - fix stack corruption with SSSE3 and AVX implementations Jussi Kivilinna
2013-05-22 14:51 ` Julian Wollrath [this message]
2013-05-23 0:32 ` Tim Chen
2013-05-28 5:53 ` 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=20130522165124.01696465@ilfaris \
--to=jwollrath@web.de \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=jussi.kivilinna@iki.fi \
--cc=linux-crypto@vger.kernel.org \
--cc=tim.c.chen@linux.intel.com \
/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