Re: [PATCH 1/2] ext4: fix warning about stack corruption

2017-08-22 Thread Anton Blanchard
> > Unfortunately it doesn't appear to work, at least with ppc64le > > clang: > > > > fs/ext4/mballoc.c:2303:17: error: fields must have a constant size: > > 'variable length array in structure' extension will never be > > supported ext4_grpblk_t counters[blocksize_bits + 2]; > > My fix for thi

Re: [PATCH 1/2] ext4: fix warning about stack corruption

2017-08-22 Thread Arnd Bergmann
On Tue, Aug 22, 2017 at 1:08 PM, Anton Blanchard wrote: > Hi Arnd, >> >> Note that while clang won't allow certain kinds of variable-length >> arrays in structures, this particular instance is fine, as the array >> is at the end of the structure, and the size is strictly bounded. > > Unfortunately

Re: [PATCH 1/2] ext4: fix warning about stack corruption

2017-08-22 Thread Anton Blanchard
Hi Arnd, > After commit 62d1034f53e3 ("fortify: use WARN instead of BUG for > now"), we get a warning about possible stack overflow from a memcpy > that was not strictly bounded to the size of the local variable: > > inlined from 'ext4_mb_seq_groups_show' at > fs/ext4/mballoc.c:2322:2: includ

Re: [PATCH 1/2] ext4: fix warning about stack corruption

2017-08-06 Thread Chandan Rajendra
On Tuesday, August 1, 2017 5:34:03 PM IST Arnd Bergmann wrote: > After commit 62d1034f53e3 ("fortify: use WARN instead of BUG for now"), > we get a warning about possible stack overflow from a memcpy that > was not strictly bounded to the size of the local variable: > > inlined from 'ext4_mb_s

Re: [PATCH 1/2] ext4: fix warning about stack corruption

2017-08-06 Thread Arnd Bergmann
On Sun, Aug 6, 2017 at 3:53 AM, Theodore Ts'o wrote: > On Tue, Aug 01, 2017 at 02:04:03PM +0200, Arnd Bergmann wrote: >> There is one remaining issue with the function that I'm not addressing >> here: With s_blocksize_bits==16, we don't actually print the last two >> members of the array, as we lo

Re: [PATCH 1/2] ext4: fix warning about stack corruption

2017-08-05 Thread Theodore Ts'o
On Tue, Aug 01, 2017 at 02:04:03PM +0200, Arnd Bergmann wrote: > There is one remaining issue with the function that I'm not addressing > here: With s_blocksize_bits==16, we don't actually print the last two > members of the array, as we loop though just the first 14 members. > This could be easily

Re: [PATCH 1/2] ext4: fix warning about stack corruption

2017-08-01 Thread Kees Cook
On Tue, Aug 1, 2017 at 5:04 AM, Arnd Bergmann wrote: > After commit 62d1034f53e3 ("fortify: use WARN instead of BUG for now"), > we get a warning about possible stack overflow from a memcpy that > was not strictly bounded to the size of the local variable: > > inlined from 'ext4_mb_seq_groups_