linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Ondrej Mosnáček" <omosnacek@gmail.com>
To: Daniel Axtens <dja@axtens.net>
Cc: leo.barbosa@canonical.com,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Stephan Mueller <smueller@chronox.de>,
	nayna@linux.ibm.com, leitao@debian.org,
	Paulo Flabiano Smorigo <pfsmorigo@gmail.com>,
	linux-crypto@vger.kernel.org, marcelo.cerri@canonical.com,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] crypto: vmx - fix copy-paste error in CTR mode
Date: Wed, 20 Mar 2019 09:40:54 +0100	[thread overview]
Message-ID: <CAAUqJDs8kCc5CbFpf_oV_v1HOiLYd1TYyx_KATt8e3fbrJG_Nw@mail.gmail.com> (raw)
In-Reply-To: <20190315020901.16509-1-dja@axtens.net>

Hi Daniel,

pi 15. 3. 2019 o 3:09 Daniel Axtens <dja@axtens.net> napísal(a):
> The original assembly imported from OpenSSL has two copy-paste
> errors in handling CTR mode. When dealing with a 2 or 3 block tail,
> the code branches to the CBC decryption exit path, rather than to
> the CTR exit path.
>
> This leads to corruption of the IV, which leads to subsequent blocks
> being corrupted.
>
> This can be detected with libkcapi test suite, which is available at
> https://github.com/smuellerDD/libkcapi
>
> Reported-by: Ondrej Mosnáček <omosnacek@gmail.com>
> Fixes: 5c380d623ed3 ("crypto: vmx - Add support for VMS instructions by ASM")
> Cc: stable@vger.kernel.org
> Signed-off-by: Daniel Axtens <dja@axtens.net>

Thank you for looking into this and for posting the patch(es)! I
tested the patch yesterday and I can confirm that it makes the
libkcapi tests/reproducer pass.

Assuming you will want to cover the other failures from the new
testmgr tests by a separate patch:

Tested-by: Ondrej Mosnacek <omosnacek@gmail.com>

> ---
>  drivers/crypto/vmx/aesp8-ppc.pl | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/crypto/vmx/aesp8-ppc.pl b/drivers/crypto/vmx/aesp8-ppc.pl
> index d6a9f63d65ba..de78282b8f44 100644
> --- a/drivers/crypto/vmx/aesp8-ppc.pl
> +++ b/drivers/crypto/vmx/aesp8-ppc.pl
> @@ -1854,7 +1854,7 @@ Lctr32_enc8x_three:
>         stvx_u          $out1,$x10,$out
>         stvx_u          $out2,$x20,$out
>         addi            $out,$out,0x30
> -       b               Lcbc_dec8x_done
> +       b               Lctr32_enc8x_done
>
>  .align 5
>  Lctr32_enc8x_two:
> @@ -1866,7 +1866,7 @@ Lctr32_enc8x_two:
>         stvx_u          $out0,$x00,$out
>         stvx_u          $out1,$x10,$out
>         addi            $out,$out,0x20
> -       b               Lcbc_dec8x_done
> +       b               Lctr32_enc8x_done
>
>  .align 5
>  Lctr32_enc8x_one:
> --
> 2.19.1
>

  parent reply	other threads:[~2019-03-20  8:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-15  2:09 [PATCH] crypto: vmx - fix copy-paste error in CTR mode Daniel Axtens
2019-03-15  2:24 ` Eric Biggers
2019-03-15  4:24   ` Daniel Axtens
2019-03-15  4:34     ` Eric Biggers
2019-03-15  5:23       ` Daniel Axtens
2019-04-10  7:02         ` Eric Biggers
2019-04-11 14:47           ` Daniel Axtens
2019-04-11 17:40             ` Nayna
2019-04-13  3:41               ` Michael Ellerman
2019-05-06 15:53                 ` Eric Biggers
2019-05-13  0:59                   ` Herbert Xu
2019-05-13 11:39                     ` Michael Ellerman
2019-05-14 17:35                       ` Daniel Axtens
2019-05-15  3:53                         ` Herbert Xu
2019-05-15  6:36                           ` Daniel Axtens
2019-05-16  2:12                             ` Daniel Axtens
2019-05-16  2:56                               ` Eric Biggers
2019-05-16  5:28                                 ` Daniel Axtens
2019-03-18  8:41       ` Michael Ellerman
2019-03-18  9:13         ` Ard Biesheuvel
2019-03-19  0:52           ` Michael Ellerman
2019-03-18  6:03 ` Michael Ellerman
2019-03-20  8:40 ` Ondrej Mosnáček [this message]
2019-03-22 13:04 ` 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=CAAUqJDs8kCc5CbFpf_oV_v1HOiLYd1TYyx_KATt8e3fbrJG_Nw@mail.gmail.com \
    --to=omosnacek@gmail.com \
    --cc=dja@axtens.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=leitao@debian.org \
    --cc=leo.barbosa@canonical.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=marcelo.cerri@canonical.com \
    --cc=nayna@linux.ibm.com \
    --cc=pfsmorigo@gmail.com \
    --cc=smueller@chronox.de \
    /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;
as well as URLs for NNTP newsgroup(s).