From: Tudor Ambarus <tudor.ambarus@microchip.com>
To: Romain Izard <romain.izard.pro@gmail.com>,
<linux-crypto@vger.kernel.org>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Cc: Cyrille Pitchen <cyrille.pitchen@atmel.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Nicolas Ferre <nicolas.ferre@microchip.com>
Subject: Re: Kernel panic when using ccm(aes) with the Atmel AES HW accelerator
Date: Mon, 23 Oct 2017 15:38:59 +0300 [thread overview]
Message-ID: <39a43561-e0e6-a3b7-e2c0-bd7e6bf1be47@microchip.com> (raw)
In-Reply-To: <CAGkQfmP6Kq4DEBbGU7AW71PjbUJ2acdJF5PVDm6VqZkUaaoEzA@mail.gmail.com>
Hi, Romain,
On 10/18/2017 04:32 PM, Romain Izard wrote:
> my fix also led to a
> systematic oops when running the ccm(aes) test case.
The NULL deference appears because of a memory corruption issue.
atmel-aes does not implement ccm(aes), so the algorithm will be in the
following form: ccm_base(atmel-ctr-aes,cbcmac(aes-generic)).
ccm auth uses the first byte of the IV as length and eventually will
memset memory to zero based on that length (see set_msg_len()). CTR
overwrites the iv with the last ciphertext block and the length will be
wrong.
I will propose a fix, but I'm taking my time to better understand why
CTR requires to overwrite the iv with the last ciphertext block.
Cheers,
ta
next prev parent reply other threads:[~2017-10-23 12:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-18 13:32 Kernel panic when using ccm(aes) with the Atmel AES HW accelerator Romain Izard
2017-10-23 12:38 ` Tudor Ambarus [this message]
2017-10-24 3:20 ` Herbert Xu
2017-10-24 9:30 ` Romain Izard
2017-10-24 15:25 ` Tudor Ambarus
2017-10-26 12:34 ` Tudor Ambarus
2017-10-27 12:02 ` Romain Izard
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=39a43561-e0e6-a3b7-e2c0-bd7e6bf1be47@microchip.com \
--to=tudor.ambarus@microchip.com \
--cc=cyrille.pitchen@atmel.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=romain.izard.pro@gmail.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