Re: [PATCH] drivers: net: wireless: ath: ath9: dfs: remove VLA usage

2018-03-13 Thread Miguel Ojeda
On Sun, Mar 11, 2018 at 12:12 AM, Kees Cook wrote: > > The problem is that it's not a "constant expression", so the compiler > frontend still yells about it under -Wvla. I would characterize this > mainly as a fix for "accidental VLA" or "misdetected VLA" or something >

Re: [PATCH] drivers: net: wireless: ath: ath9: dfs: remove VLA usage

2018-03-13 Thread Daniel Micay
> I don't think the difference between C and C++ const pointer > conversions I mean I don't think the difference between them was intended.

Re: [PATCH] drivers: net: wireless: ath: ath9: dfs: remove VLA usage

2018-03-13 Thread Daniel Micay
No, it's undefined behavior to write to a const variable. The `static` and `const` on the variable both change the code generation in the real world as permitted / encouraged by the standard. It's placed in read-only memory. Trying to write to it will break. It's not "implemented defined" to write

RE: [PATCH] drivers: net: wireless: ath: ath9: dfs: remove VLA usage

2018-03-13 Thread David Laight
From: Daniel Micay > Sent: 10 March 2018 23:45 > > > 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. > > The issue is that unlike in C++, a `static const`

Re: [PATCH] drivers: net: wireless: ath: ath9: dfs: remove VLA usage

2018-03-10 Thread Gustavo A. R. Silva
On 03/10/2018 05:12 PM, Kees Cook wrote: On Sat, Mar 10, 2018 at 3:06 PM, Arend van Spriel wrote: 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

Re: [PATCH] drivers: net: wireless: ath: ath9: dfs: remove VLA usage

2018-03-10 Thread Daniel Micay
> 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. The issue is that unlike in C++, a `static const` can't be used in a constant expression in C. It's unclear why C

Re: [PATCH] drivers: net: wireless: ath: ath9: dfs: remove VLA usage

2018-03-10 Thread Kees Cook
On Sat, Mar 10, 2018 at 3:06 PM, Arend van Spriel wrote: > 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

Re: [PATCH] drivers: net: wireless: ath: ath9: dfs: remove VLA usage

2018-03-10 Thread Arend van Spriel
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

Re: [PATCH] drivers: net: wireless: ath: ath9: dfs: remove VLA usage

2018-03-09 Thread Kalle Valo
Himanshu Jha writes: > On Fri, Mar 09, 2018 at 02:30:12PM +0200, Andreas Christoforou wrote: >> The kernel would like to have all stack VLA usage removed. >> >> Signed-off-by: Andreas Christoforou >> --- >>

Re: [PATCH] drivers: net: wireless: ath: ath9: dfs: remove VLA usage

2018-03-09 Thread Himanshu Jha
On Fri, Mar 09, 2018 at 02:30:12PM +0200, Andreas Christoforou wrote: > The kernel would like to have all stack VLA usage removed. > > Signed-off-by: Andreas Christoforou > --- > drivers/net/wireless/ath/ath9k/dfs.c | 3 +-- > 1 file changed, 1 insertion(+), 2