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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux