[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180408092219.s24ymooq7afu43c2@gondor.apana.org.au>
Date: Sun, 8 Apr 2018 17:22:19 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Salvatore Mesoraca <s.mesoraca16@...il.com>
Cc: linux-kernel@...r.kernel.org,
Kernel Hardening <kernel-hardening@...ts.openwall.com>,
linux-crypto@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>,
Kees Cook <keescook@...omium.org>,
Eric Biggers <ebiggers3@...il.com>,
Laura Abbott <labbott@...hat.com>
Subject: Re: [PATCH 3/6] crypto: api - avoid VLA use
On Sun, Apr 08, 2018 at 11:07:12AM +0200, Salvatore Mesoraca wrote:
>
> > This check should be done when the algorithm is registered. Perhaps
> > crypto_check_alg.
>
> Please correct me if I'm wrong:
> isn't crypto_check_alg invoked also during hashing algorithm registration?
> In this patch-set I'm dealing only with ciphers, because the maximum
> block size (16)
> is relatively small and it's also the most common block size with
> ciphers (maybe I should
> have explicitly referenced ciphers in the macro names, my bad).
> I don't think that it would be OK to use a similar approach for hashes
> too, because some
> of them have block size >= 1024 bytes.
Yes we want to make it for ciphers only even if we move it to
crypto_check_alg.
For a legacy type like cipher cou can do it by
if (!alg->cra_type && (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) ==
CRYPTO_ALG_TYPE_CIPHER)
do_cipher_specific_check();
Cheers,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists