Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 9 Mar 2018 07:42:02 -0800
From: Rosen Penev <rosenp@...il.com>
To: Joe Perches <joe@...ches.com>
Cc: Andreas Christoforou <andreaschristofo@...il.com>, keescook@...omium.org, 
	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: ath9k: dfs: remove VLA usage

On Fri, Mar 9, 2018 at 5:29 AM, Joe Perches <joe@...ches.com> wrote:
> On Fri, 2018-03-09 at 15:23 +0200, Andreas Christoforou wrote:
>> The kernel would like to have all stack VLA usage removed.
>> This is the correct patch.
> []
>> diff --git a/drivers/net/wireless/ath/ath9k/dfs.c b/drivers/net/wireless/ath/ath9k/dfs.c
> []
>> @@ -101,7 +101,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];
>>       struct ath_hw *ah = sc->sc_ah;
>>       struct ath_common *common = ath9k_hw_common(ah);
>>       int prev_delta;
>
> why not just change FFT_NUM_SAMPLES to a #define
> or get rid if FFT_NUM_SAMPLES altogether?
>
I did the former yesterday. Never submitted.
> $ git grep -w FFT_NUM_SAMPLES
> drivers/net/wireless/ath/ath9k/dfs.c:static const int FFT_NUM_SAMPLES   = (NUM_DIFFS + 1);
> drivers/net/wireless/ath/ath9k/dfs.c:   int max_bin[FFT_NUM_SAMPLES];
> drivers/net/wireless/ath/ath9k/dfs.c:           if (num_fft_packets < (FFT_NUM_SAMPLES)) {
> drivers/net/wireless/ath/ath9k/dfs.c:           for (i = 0; i < FFT_NUM_SAMPLES; i++)
> drivers/net/wireless/ath/ath9k/dfs.c:           if (num_fft_packets < (FFT_NUM_SAMPLES)) {
> drivers/net/wireless/ath/ath9k/dfs.c:           for (i = 0; i < FFT_NUM_SAMPLES; i++)

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.