lkml.org 
[lkml]   [2016]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] lkdtm: Prevent the compiler from optimising lkdtm_CORRUPT_STACK()
On Tue, Nov 15, 2016 at 09:27:47AM -0800, Kees Cook wrote:
> On Mon, Nov 14, 2016 at 11:02 PM, Michael Ellerman <mpe@ellerman.id.au> 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 from optimising away data and the memset().
> >
> > Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
>
> Acked-by: Kees Cook <keescook@chromium.org>
>
> Greg, can you add this to the drivers/misc?

Now added, thanks.

greg k-h

\
 
 \ /
  Last update: 2016-11-15 19:27    [W:0.047 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site