|
Message-Id: <1533F2BB-2284-499B-9912-6D74D0B87BC1@gmail.com> Date: Mon, 11 Feb 2019 10:45:26 -0800 From: Nadav Amit <nadav.amit@...il.com> To: Borislav Petkov <bp@...en8.de> 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>, 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>, "Dock, Deneen T" <deneen.t.dock@...el.com>, Kees Cook <keescook@...omium.org>, Dave Hansen <dave.hansen@...el.com>, Masami Hiramatsu <mhiramat@...nel.org> Subject: Re: [PATCH v2 10/20] x86: avoid W^X being broken during modules loading > On Feb 11, 2019, at 10:29 AM, Borislav Petkov <bp@...en8.de> wrote: > >> diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c >> index 76d482a2b716..69f3e650ada8 100644 >> --- a/arch/x86/kernel/alternative.c >> +++ b/arch/x86/kernel/alternative.c >> @@ -667,15 +667,29 @@ void __init alternative_instructions(void) >> * handlers seeing an inconsistent instruction while you patch. >> */ >> void *__init_or_module text_poke_early(void *addr, const void *opcode, >> - size_t len) >> + size_t len) >> { >> unsigned long flags; >> - local_irq_save(flags); >> - memcpy(addr, opcode, len); >> - local_irq_restore(flags); >> - sync_core(); >> - /* Could also do a CLFLUSH here to speed up CPU recovery; but >> - that causes hangs on some VIA CPUs. */ >> + >> + if (static_cpu_has(X86_FEATURE_NX) && > > Not a fast path - boot_cpu_has() is fine here. Are you sure about that? This path is still used when modules are loaded.
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.