stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Lamparter <chunkeey@gmail.com>
To: Hauke Mehrtens <hauke@hauke-m.de>
Cc: herbert@gondor.apana.org.au, davem@davemloft.net,
	gregkh@linuxfoundation.org, stable <stable@vger.kernel.org>,
	linux-crypto@vger.kernel.org,
	Amit Pundir <amit.pundir@linaro.org>
Subject: Re: crypto: crypto4xx - properly set IV after de- and encrypt breaks kernel 4.4
Date: Thu, 20 Jun 2019 14:07:27 +0200	[thread overview]
Message-ID: <4226536.PGTo7a8ESG@debian64> (raw)
In-Reply-To: <9d744c3b-d4ff-b84b-527b-fc050794499b@hauke-m.de>

On Thursday, June 20, 2019 11:36:50 AM CEST Hauke Mehrtens wrote:
> Hi,
> 
> The patch "crypto: crypto4xx - properly set IV after de- and encrypt"
> causes a compile error on kernel 4.4.

3.18 as well.
> 
> When I revert this commit it compiles for me again:
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e9a60ab1609a7d975922adad1bf9c46ac6954584
> 
> I do not have hardware to test if it is really working.

I have a few APM821XX. But please note drivers without

commit b66c685a482117d4e9ee987d252ca673689a5302
Author: Christian Lamparter <chunkeey@gmail.com>
Date:   Fri Dec 22 21:18:36 2017 +0100

    crypto: crypto4xx - support Revision B parts

don't work on those and I do have my doubts that 460EX
series (and older) would either. I also don't believe that
the inital driver as it was submitted would have worked.
From what I've seen in their SDK, they patched the testmgr
at the time to either disable tests or provided their own...
so, might as well revert these patches for 4.4 and 3.18.

Because...
 
> drivers/crypto/amcc/crypto4xx_core.c: In function
> 'crypto4xx_ablkcipher_done':
> drivers/crypto/amcc/crypto4xx_core.c:649:21: warning: dereferencing
> 'void *' pointer
>   if (pd_uinfo->sa_va->sa_command_0.bf.save_iv == SA_SAVE_IV) {

This would probably need 
9e0a0b3a1 ("crypto: crypto4xx - pointer arithmetic overhaul") which is
a big patch.

>                      ^
> drivers/crypto/amcc/crypto4xx_core.c:649:21: error: request for member
> 'sa_command_0' in something not a structure or union
> drivers/crypto/amcc/crypto4xx_core.c:650:38: error: implicit declaration
> of function 'crypto_skcipher_reqtfm' [-Werror=implicit-function-declaration]
>    struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req);
>                                       ^
This would require adding #include <crypto/skcipher.h> to crypto4xx_core.c

The patch that added it upstream was 
ce05ffe10457 ("crypto: crypto4xx - convert to skcipher")

But this is more than just a one-liner.

> drivers/crypto/amcc/crypto4xx_core.c:650:61: error: 'req' undeclared
> (first use in this function)
>    struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req);
>                                                              ^
> drivers/crypto/amcc/crypto4xx_core.c:650:61: note: each undeclared
> identifier is reported only once for each function it appears in
see "#include <crypto/skcipher.h>"

> drivers/crypto/amcc/crypto4xx_core.c:652:3: error: implicit declaration
> of function 'crypto4xx_memcpy_from_le32'
> [-Werror=implicit-function-declaration]
>    crypto4xx_memcpy_from_le32((u32 *)req->iv,
>    ^

crypto4xx_memcpy_from_le32 is from
4865b122d4af ("crypto: crypto4xx - use the correct LE32 format for IV and key defs")

I think crypto4xx_memcpy_le() could work in this place.
But again I do have my doubts that the device works
without said patch.

> drivers/crypto/amcc/crypto4xx_core.c:653:19: warning: dereferencing
> 'void *' pointer
>     pd_uinfo->sr_va->save_iv,
>                    ^
> drivers/crypto/amcc/crypto4xx_core.c:653:19: error: request for member
> 'save_iv' in something not a structure or union
See "crypto: crypto4xx - pointer arithmetic overhaul".
> drivers/crypto/amcc/crypto4xx_core.c:654:4: error: implicit declaration
> of function 'crypto_skcipher_ivsize' [-Werror=implicit-function-declaration]
>     crypto_skcipher_ivsize(skcipher));
>     ^

see "#include <crypto/skcipher.h>"

(Yeaah, there seems to be a limit of what automatic cherry-picking of
patches can do :( )




  reply	other threads:[~2019-06-20 12:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20  9:36 crypto: crypto4xx - properly set IV after de- and encrypt breaks kernel 4.4 Hauke Mehrtens
2019-06-20 12:07 ` Christian Lamparter [this message]
2019-06-20 14:07   ` Greg KH

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=4226536.PGTo7a8ESG@debian64 \
    --to=chunkeey@gmail.com \
    --cc=amit.pundir@linaro.org \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hauke@hauke-m.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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).