Re: [PATCH v3 3/5] kasan: support alloca() poisoning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 12/04/2017 07:55 PM, Andrey Ryabinin wrote:
> 
> 
> On 12/04/2017 07:42 PM, Christoph Hellwig wrote:
>> I don't think we are using alloca in kernel mode code, and we shouldn't.
>> What do I miss?  Is this hidden support for on-stack VLAs?  I thought
>> we'd get rid of them as well.
>>
> 
> Yes, this is for on-stack VLA. Last time I checked, we still had a few.
> 

E.g. building with -Wvla:


/home/andrew/linux/sound/core/pcm_native.c: In function ‘constrain_params_by_rules’:
/home/andrew/linux/sound/core/pcm_native.c:326:2: warning: ISO C90 forbids variable length array ‘rstamps’ [-Wvla]
  unsigned int rstamps[constrs->rules_num];
  ^~~~~~~~
In file included from /home/andrew/linux/crypto/cbc.c:14:0:
/home/andrew/linux/include/crypto/cbc.h: In function ‘crypto_cbc_decrypt_inplace’:
/home/andrew/linux/include/crypto/cbc.h:116:2: warning: ISO C90 forbids variable length array ‘last_iv’ [-Wvla]
  u8 last_iv[bsize];
  ^~
/home/andrew/linux/crypto/pcbc.c: In function ‘crypto_pcbc_encrypt_inplace’:
/home/andrew/linux/crypto/pcbc.c:75:2: warning: ISO C90 forbids variable length array ‘tmpbuf’ [-Wvla]
  u8 tmpbuf[bsize];
  ^~
/home/andrew/linux/crypto/pcbc.c: In function ‘crypto_pcbc_decrypt_inplace’:
/home/andrew/linux/crypto/pcbc.c:147:2: warning: ISO C90 forbids variable length array ‘tmpbuf’ [-Wvla]
  u8 tmpbuf[bsize] __aligned(__alignof__(u32));
  ^~
/home/andrew/linux/crypto/cts.c: In function ‘cts_cbc_encrypt’:
/home/andrew/linux/crypto/cts.c:107:2: warning: ISO C90 forbids variable length array ‘d’ [-Wvla]
  u8 d[bsize * 2] __aligned(__alignof__(u32));
  ^~
/home/andrew/linux/crypto/cts.c: In function ‘cts_cbc_decrypt’:
/home/andrew/linux/crypto/cts.c:186:2: warning: ISO C90 forbids variable length array ‘d’ [-Wvla]
  u8 d[bsize * 2] __aligned(__alignof__(u32));
  ^~
/home/andrew/linux/crypto/ctr.c: In function ‘crypto_ctr_crypt_final’:
/home/andrew/linux/crypto/ctr.c:61:2: warning: ISO C90 forbids variable length array ‘tmp’ [-Wvla]
  u8 tmp[bsize + alignmask];
  ^~
/home/andrew/linux/crypto/ctr.c: In function ‘crypto_ctr_crypt_inplace’:
/home/andrew/linux/crypto/ctr.c:109:2: warning: ISO C90 forbids variable length array ‘tmp’ [-Wvla]
  u8 tmp[bsize + alignmask];

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux