Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 9 Mar 2018 21:35:21 +0300
From: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To: Andreas Christoforou <andreaschristofo@...il.com>, keescook@...omium.org
Cc: kernel-hardening@...ts.openwall.com,
 Steffen Klassert <steffen.klassert@...unet.com>,
 Herbert Xu <herbert@...dor.apana.org.au>,
 "David S. Miller" <davem@...emloft.net>,
 Alexey Kuznetsov <kuznet@....inr.ac.ru>,
 Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>, netdev@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: ipv6: xfrm6_state: remove VLA usage

Hello!

On 03/09/2018 03:21 PM, Andreas Christoforou wrote:

> The kernel would like to have all stack VLA usage removed[1].
> 
> Signed-off-by: Andreas Christoforou <andreaschristofo@...il.com>
> ---
>  net/ipv6/xfrm6_state.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c
> index b15075a..45c0d98 100644
> --- a/net/ipv6/xfrm6_state.c
> +++ b/net/ipv6/xfrm6_state.c
> @@ -62,7 +62,12 @@ __xfrm6_sort(void **dst, void **src, int n, int (*cmp)(void *p), int maxclass)
>  {
>  	int i;
>  	int class[XFRM_MAX_DEPTH];
> -	int count[maxclass];
> +	int *count;
> +
> +	count = kcalloc(maxclass + 1, sizeof(*count), GFP_KERNEL);
> +

  Empty line not needed here.

> +	if (!count)
> +		return -ENOMEM;
>  
>  	memset(count, 0, sizeof(count));
>  
[...]

MBR, Sergei

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.