Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 11 Mar 2018 00:06:06 +0100
From: Arend van Spriel <arend.vanspriel@...adcom.com>
To: Andreas Christoforou <andreaschristofo@...il.com>, keescook@...omium.org
Cc: kernel-hardening@...ts.openwall.com,
 QCA ath9k Development <ath9k-devel@....qualcomm.com>,
 Kalle Valo <kvalo@...eaurora.org>, linux-wireless@...r.kernel.org,
 netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers: net: wireless: ath: ath9: dfs: remove VLA usage

On 3/9/2018 1:30 PM, Andreas Christoforou wrote:
> The kernel would like to have all stack VLA usage removed.

I think there was a remark made earlier to give more explanation here. 
It should explain why we want "VLA on stack" removed.

> Signed-off-by: Andreas Christoforou <andreaschristofo@...il.com>
> ---
>   drivers/net/wireless/ath/ath9k/dfs.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/dfs.c b/drivers/net/wireless/ath/ath9k/dfs.c
> index 6fee9a4..cfb0f84 100644
> --- a/drivers/net/wireless/ath/ath9k/dfs.c
> +++ b/drivers/net/wireless/ath/ath9k/dfs.c
> @@ -41,7 +41,6 @@ static const int BIN_DELTA_MAX		= 10;
>
>   /* we need at least 3 deltas / 4 samples for a reliable chirp detection */
>   #define NUM_DIFFS 3
> -static const int FFT_NUM_SAMPLES	= (NUM_DIFFS + 1);
>
>   /* Threshold for difference of delta peaks */
>   static const int MAX_DIFF		= 2;
> @@ -101,7 +100,7 @@ static bool ath9k_check_chirping(struct ath_softc *sc, u8 *data,
>   				 int datalen, bool is_ctl, bool is_ext)
>   {
>   	int i;
> -	int max_bin[FFT_NUM_SAMPLES];
> +	int max_bin[NUM_DIFFS + 1];

Just wondering. Is this actually a VLA. FFT_NUM_SAMPLES was static const 
so not really going to show a lot of variation. This array will always 
have the same size on the stack.

Regards,
Arend

Powered by blists - more mailing lists

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