Re: [PATCH] lkdtm: Prevent the compiler from optimising lkdtm_CORRUPT_STACK()

2016-11-15 Thread Greg KH
On Tue, Nov 15, 2016 at 09:27:47AM -0800, Kees Cook wrote: > On Mon, Nov 14, 2016 at 11:02 PM, Michael Ellerman > wrote: > > At least on powerpc with GCC 6, the compiler is smart enough to optimise > > lkdtm_CORRUPT_STACK() into an empty function that just returns. > > Sneaky. Thanks! > > > If

Re: [PATCH] lkdtm: Prevent the compiler from optimising lkdtm_CORRUPT_STACK()

2016-11-15 Thread Kees Cook
On Mon, Nov 14, 2016 at 11:02 PM, Michael Ellerman wrote: > At least on powerpc with GCC 6, the compiler is smart enough to optimise > lkdtm_CORRUPT_STACK() into an empty function that just returns. Sneaky. Thanks! > If we print the buffer after we've written to it that prevents the > compiler f

[PATCH] lkdtm: Prevent the compiler from optimising lkdtm_CORRUPT_STACK()

2016-11-14 Thread Michael Ellerman
At least on powerpc with GCC 6, the compiler is smart enough to optimise lkdtm_CORRUPT_STACK() into an empty function that just returns. If we print the buffer after we've written to it that prevents the compiler from optimising away data and the memset(). Signed-off-by: Michael Ellerman --- dr