Date: Wed, 6 Feb 2019 12:41:08 -0500 From: Steven Rostedt <rostedt@...dmis.org> To: Nadav Amit <nadav.amit@...il.com> Cc: Rick Edgecombe <rick.p.edgecombe@...el.com>, Andy Lutomirski <luto@...nel.org>, Ingo Molnar <mingo@...hat.com>, LKML <linux-kernel@...r.kernel.org>, X86 ML <x86@...nel.org>, "H. Peter Anvin" <hpa@...or.com>, Thomas Gleixner <tglx@...utronix.de>, Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>, Peter Zijlstra <peterz@...radead.org>, Damian Tometzki <linux_dti@...oud.com>, linux-integrity <linux-integrity@...r.kernel.org>, LSM List <linux-security-module@...r.kernel.org>, Andrew Morton <akpm@...ux-foundation.org>, Kernel Hardening <kernel-hardening@...ts.openwall.com>, Linux-MM <linux-mm@...ck.org>, Will Deacon <will.deacon@....com>, Ard Biesheuvel <ard.biesheuvel@...aro.org>, Kristen Carlson Accardi <kristen@...ux.intel.com>, deneen.t.dock@...el.com Subject: Re: [PATCH 08/17] x86/ftrace: set trampoline pages as executable On Wed, 6 Feb 2019 09:33:35 -0800 Nadav Amit <nadav.amit@...il.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
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.