Re: [v3] crypto: ctr - avoid VLA use
From: Salvatore Mesoraca
Date: Wed Apr 04 2018 - 05:50:21 EST
2018-04-03 23:37 GMT+02:00 Laura Abbott <labbott@xxxxxxxxxx>:
> On 03/30/2018 01:53 AM, Salvatore Mesoraca wrote:
>> ---
>> crypto/ctr.c | 15 +++++++++++++--
>> 1 file changed, 13 insertions(+), 2 deletions(-)
>>
>> diff --git a/crypto/ctr.c b/crypto/ctr.c
>> index 854d924..49c469d 100644
>> --- a/crypto/ctr.c
>> +++ b/crypto/ctr.c
>> @@ -21,6 +21,9 @@
>> #include <linux/scatterlist.h>
>> #include <linux/slab.h>
>> +#define MAX_BLOCKSIZE 16
>> +#define MAX_ALIGNMASK 15
>> +
>
>
> Can we pull this out into a header file, I think this would cover
>
> crypto/cipher.c: In function âcipher_crypt_unalignedâ:
> crypto/cipher.c:70:2: warning: ISO C90 forbids variable length array
> âbufferâ [-Wvla]
> u8 buffer[size + alignmask];
> ^~
Yeah, I'll send a patchset that includes the fix for crypto/cipher.c too.
Thank you for the suggestion :)
Salvatore