lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Thu, 30 Aug 2018 10:32:18 -0700 From: Nadav Amit <namit@...are.com> To: Thomas Gleixner <tglx@...utronix.de> CC: <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...hat.com>, <x86@...nel.org>, Arnd Bergmann <arnd@...db.de>, <linux-arch@...r.kernel.org>, Dave Hansen <dave.hansen@...ux.intel.com>, Nadav Amit <namit@...are.com>, Andy Lutomirski <luto@...nel.org>, Masami Hiramatsu <mhiramat@...nel.org>, Kees Cook <keescook@...omium.org>, Peter Zijlstra <peterz@...radead.org> Subject: [PATCH 6/6] x86/alternatives: remove text_poke() return value The return value of text_poke() is meaningless - it is one of the function inputs. One day someone may allow the callers to deal with text_poke() failures, if those actually happen. In the meanwhile, remove the return value. Cc: Andy Lutomirski <luto@...nel.org> Cc: Masami Hiramatsu <mhiramat@...nel.org> Cc: Kees Cook <keescook@...omium.org> Cc: Peter Zijlstra <peterz@...radead.org> Signed-off-by: Nadav Amit <namit@...are.com> --- arch/x86/include/asm/text-patching.h | 2 +- arch/x86/kernel/alternative.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/text-patching.h b/arch/x86/include/asm/text-patching.h index ffe7902cc326..1f73f71b4de2 100644 --- a/arch/x86/include/asm/text-patching.h +++ b/arch/x86/include/asm/text-patching.h @@ -34,7 +34,7 @@ extern void *text_poke_early(void *addr, const void *opcode, size_t len); * On the local CPU you need to be protected again NMI or MCE handlers seeing an * inconsistent instruction while you patch. */ -extern void *text_poke(void *addr, const void *opcode, size_t len); +extern void text_poke(void *addr, const void *opcode, size_t len); extern int poke_int3_handler(struct pt_regs *regs); extern void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler); extern int after_bootmem; diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 2b976296c9f3..840448ca357e 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -809,7 +809,7 @@ static void text_poke_safe(void *addr, const void *opcode, size_t len, * holding the mutex and ensures that none of them will acquire the * mutex while the code runs. */ -void *text_poke(void *addr, const void *opcode, size_t len) +void text_poke(void *addr, const void *opcode, size_t len) { bool cross_page_boundary = offset_in_page(addr) + len > PAGE_SIZE; struct page *pages[2] = {0}; @@ -851,7 +851,6 @@ void *text_poke(void *addr, const void *opcode, size_t len) BUG_ON(memcmp(addr, opcode, len)); local_irq_restore(flags); - return addr; } static void do_sync_core(void *info) -- 2.17.1
Powered by blists - more mailing lists