lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 13 Mar 2018 08:30:51 -0500
From:   "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To:     Mauro Carvalho Chehab <mchehab@...pensource.com>
Cc:     Borislav Petkov <bp@...en8.de>, linux-edac@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] EDAC, sb_edac: Remove VLA usage



On 03/13/2018 08:21 AM, Mauro Carvalho Chehab wrote:
> Em Tue, 13 Mar 2018 06:20:34 -0500
> "Gustavo A. R. Silva" <gustavo@...eddedor.com> escreveu:
> 
>> In preparation to enabling -Wvla, remove VLA and replace it
>> with a fixed-length array instead.
>>
>> Fixed as part of the directive to remove all VLAs from
>> the kernel: https://lkml.org/lkml/2018/3/7/621
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
>> ---
>> Changes in v2:
>>   - Use macro max_t to compute the max of all three array sizes.
>>     This change is based on Borislav's feedback.
>>
>>   drivers/edac/sb_edac.c | 6 +++++-
>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
>> index 8721002..196b012 100644
>> --- a/drivers/edac/sb_edac.c
>> +++ b/drivers/edac/sb_edac.c
>> @@ -110,6 +110,10 @@ static const u32 knl_interleave_list[] = {
>>   	0xdc, 0xe4, 0xec, 0xf4, 0xfc, /* 15-19 */
>>   	0x104, 0x10c, 0x114, 0x11c,   /* 20-23 */
>>   };
>> +#define MAX_INTERLEAVE (max_t(unsigned int, ARRAY_SIZE(sbridge_interleave_list),\
>> +			max_t(unsigned int, ARRAY_SIZE(ibridge_interleave_list),\
>> +					    ARRAY_SIZE(knl_interleave_list))))
>> +
> 
> In order to avoid too long lines, it would be better to do it as:
> 
> #define MAX_INTERLEAVE						        \
> 	(max_t(unsigned int, ARRAY_SIZE(sbridge_interleave_list),       \
> 	       max_t(unsigned int, ARRAY_SIZE(ibridge_interleave_list), \
> 		     ARRAY_SIZE(knl_interleave_list))))
> 

Yep. I agree.

> 
> With that:
> 
> Reviewed-by: Mauro Carvalho Chehab <mchehab@...pensource.com>
> 

I'll send v3 and add your Reviewed-by.

Thanks, Mauro.
--
Gustavo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ