lkml.org 
[lkml]   [2019]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 08/17] x86/ftrace: set trampoline pages as executable
On Wed, 6 Feb 2019 09:33:35 -0800
Nadav Amit <nadav.amit@gmail.com> wrote:


> >> /* Copy ftrace_caller onto the trampoline memory */
> >> ret = probe_kernel_read(trampoline, (void *)start_offset, size);
> >> @@ -818,6 +820,13 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size)
> >> /* ALLOC_TRAMP flags lets us know we created it */
> >> ops->flags |= FTRACE_OPS_FL_ALLOC_TRAMP;
> >>
> >> + /*
> >> + * Module allocation needs to be completed by making the page
> >> + * executable. The page is still writable, which is a security hazard,
> >> + * but anyhow ftrace breaks W^X completely.
> >> + */
> >
> > Perhaps we should set the page to non writable after the page is
> > updated? And set it to writable only when we need to update it.
>
> You remember that I sent you a patch that changed all these writes into
> text_poke() and you said that I should defer it until this series is merged?
>

And I notice that it is set to RO after this call anyway.

-- Steve

\
 
 \ /
  Last update: 2019-02-06 18:42    [W:2.083 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site