From: Herbert Xu <herbert@gondor.apana.org.au>
To: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Cc: Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
Ard Biesheuvel <ardb@kernel.org>
Subject: Re: [PATCH] crypto: arm64/aes-ccm - Rewrite skcipher walker loop
Date: Wed, 1 Feb 2023 16:55:47 +0800 [thread overview]
Message-ID: <Y9opEyTFKXAVjk/D@gondor.apana.org.au> (raw)
In-Reply-To: <b83ca139-1e8c-60f3-939f-15f727710c36@linux.alibaba.com>
On Wed, Feb 01, 2023 at 10:53:37AM +0800, Tianjia Zhang wrote:
>
> while (walk.nbytes != walk.total) {
This is still buggy, because we can have walk.nbytes == 0 and
walk.nbytes != walk.total. You will enter the loop and call
skcipher_walk_done which is not allowed.
That is why you should follow the standard calling convention
for skcipher walks, always check for walk.nbytes != 0 and not
whether the walk returns an error.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
next prev parent reply other threads:[~2023-02-01 8:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 8:58 [PATCH] crypto: arm64/aes-ccm - Rewrite skcipher walker loop Herbert Xu
2023-01-30 10:42 ` Ard Biesheuvel
2023-01-31 3:19 ` Herbert Xu
2023-02-01 2:53 ` Tianjia Zhang
2023-02-01 8:55 ` Herbert Xu [this message]
2023-02-01 9:15 ` Tianjia Zhang
2023-02-01 9:21 ` Herbert Xu
2023-02-01 9:43 ` Tianjia Zhang
2023-02-01 9:50 ` Herbert Xu
2023-02-01 9:54 ` Tianjia Zhang
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=Y9opEyTFKXAVjk/D@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=ardb@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=tianjia.zhang@linux.alibaba.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