Re: [PATCH] iio: potentiometer: ds1803: remove VLA usage

2018-03-13 Thread Gustavo A. R. Silva
On 03/13/2018 11:59 AM, Himanshu Jha wrote: On Tue, Mar 13, 2018 at 11:31:19AM -0500, Gustavo A. R. Silva wrote: On 03/13/2018 11:24 AM, Himanshu Jha wrote: Hi Gustavo, On Tue, Mar 13, 2018 at 10:23:43AM -0500, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA. In th

Re: [PATCH] iio: potentiometer: ds1803: remove VLA usage

2018-03-13 Thread Gustavo A. R. Silva
On 03/13/2018 11:59 AM, Himanshu Jha wrote: On Tue, Mar 13, 2018 at 11:31:19AM -0500, Gustavo A. R. Silva wrote: On 03/13/2018 11:24 AM, Himanshu Jha wrote: Hi Gustavo, On Tue, Mar 13, 2018 at 10:23:43AM -0500, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA. In th

Re: [PATCH] iio: potentiometer: ds1803: remove VLA usage

2018-03-13 Thread Himanshu Jha
On Tue, Mar 13, 2018 at 11:31:19AM -0500, Gustavo A. R. Silva wrote: > > > On 03/13/2018 11:24 AM, Himanshu Jha wrote: > >Hi Gustavo, > > > >On Tue, Mar 13, 2018 at 10:23:43AM -0500, Gustavo A. R. Silva wrote: > >>In preparation to enabling -Wvla, remove VLA. In this particular > >>case use macro

Re: [PATCH] iio: potentiometer: ds1803: remove VLA usage

2018-03-13 Thread Gustavo A. R. Silva
On 03/13/2018 11:24 AM, Himanshu Jha wrote: Hi Gustavo, On Tue, Mar 13, 2018 at 10:23:43AM -0500, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA. In this particular case use macro ARRAY_SIZE so the length of array _result_ can be computed at preprocessing time. The u

Re: [PATCH] iio: potentiometer: ds1803: remove VLA usage

2018-03-13 Thread Himanshu Jha
Hi Gustavo, On Tue, Mar 13, 2018 at 10:23:43AM -0500, Gustavo A. R. Silva wrote: > In preparation to enabling -Wvla, remove VLA. In this particular > case use macro ARRAY_SIZE so the length of array _result_ can be > computed at preprocessing time. > > The use of stack Variable Length Arrays need

Re: [PATCH] iio: potentiometer: ds1803: Remove VLA usage

2018-03-10 Thread Jonathan Cameron
On Fri, 9 Mar 2018 16:35:10 +0530 Himanshu Jha wrote: > On Thu, Mar 08, 2018 at 11:39:15AM -0800, Kees Cook wrote: > > On Thu, Mar 8, 2018 at 10:45 AM, Himanshu Jha > > wrote: > > > In preparation to enabling -Wvla, remove VLA usage and replace it > > > with fixed a fixed length array and ther

Re: [PATCH] iio: potentiometer: ds1803: Remove VLA usage

2018-03-09 Thread Himanshu Jha
On Thu, Mar 08, 2018 at 11:39:15AM -0800, Kees Cook wrote: > On Thu, Mar 8, 2018 at 10:45 AM, Himanshu Jha > wrote: > > In preparation to enabling -Wvla, remove VLA usage and replace it > > with fixed a fixed length array and therefore, prevent potential > > stack overflow attacks. > > > > Fixed a

Re: [PATCH] iio: potentiometer: ds1803: Remove VLA usage

2018-03-08 Thread Kees Cook
On Thu, Mar 8, 2018 at 10:45 AM, Himanshu Jha wrote: > In preparation to enabling -Wvla, remove VLA usage and replace it > with fixed a fixed length array and therefore, prevent potential > stack overflow attacks. > > Fixed as a part of the discussion to remove all VLAs from the kernel: > https://