From patchwork Tue Apr 30 11:24:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot for Kobe Wu X-Patchwork-Id: 10923321 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C6FD14B6 for ; Tue, 30 Apr 2019 11:31:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B85B28AA8 for ; Tue, 30 Apr 2019 11:31:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F9BE28AAC; Tue, 30 Apr 2019 11:31:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 0571B28AA8 for ; Tue, 30 Apr 2019 11:31:55 +0000 (UTC) Received: (qmail 23885 invoked by uid 550); 30 Apr 2019 11:30:29 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Delivered-To: moderator for kernel-hardening@lists.openwall.com Received: (qmail 17960 invoked from network); 30 Apr 2019 11:24:42 -0000 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x3UBOBdF1349793 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019041745; t=1556623452; bh=jkpd+GVdrkh7KzOnB4lfVWgT8IU7cAG8FRCqg3nsW2c=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=TFSoNBH0Q7xSDHMm4potaxttnfnwDqF0qh5Ylki4CNuADFrKHAkKWVmB2HuBQpsBJ VUhEQzQoSMf9JFoNn5WSalRq5abBysqzoMaoBJYTpYLX0gGuz12ibJmFKBSDopPYPw PUjdzOwJWWGWAhM3fM1g6GXj//upR5urFmxhocxD81H5jIsDMoGR7TmujLImzhGtaZ GmxO55dG1y8ClJJYnc1cIW7xHj/OQ71xkbNIgpV70DUDymC8GGXPyV35eq3kdi2n2h POBy4li8F9eLblyvff6BxqgCGUpvL3qP1e8bC4hLF+VnHzGnI8xghAlyuKCjw4uJsZ mXa1deCnbxeKw== Date: Tue, 30 Apr 2019 04:24:09 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f Sender: tip tree robot From: tip-bot for Nadav Amit Message-ID: Cc: mhiramat@kernel.org, torvalds@linux-foundation.org, kernel-hardening@lists.openwall.com, tglx@linutronix.de, rick.p.edgecombe@intel.com, ard.biesheuvel@linaro.org, will.deacon@arm.com, linux-kernel@vger.kernel.org, hpa@zytor.com, kristen@linux.intel.com, akpm@linux-foundation.org, linux_dti@icloud.com, dave.hansen@intel.com, deneen.t.dock@intel.com, namit@vmware.com, riel@surriel.com, mingo@kernel.org, luto@kernel.org, keescook@chromium.org, peterz@infradead.org, bp@alien8.de In-Reply-To: <20190426001143.4983-14-namit@vmware.com> References: <20190426001143.4983-14-namit@vmware.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/mm] x86/alternatives: Remove the return value of text_poke_*() Git-Commit-ID: 0a203df5cf0eb709be4f190314e262b72d7e5b76 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Disposition: inline X-Virus-Scanned: ClamAV using ClamSMTP Commit-ID: 0a203df5cf0eb709be4f190314e262b72d7e5b76 Gitweb: https://git.kernel.org/tip/0a203df5cf0eb709be4f190314e262b72d7e5b76 Author: Nadav Amit AuthorDate: Thu, 25 Apr 2019 17:11:33 -0700 Committer: Ingo Molnar CommitDate: Tue, 30 Apr 2019 12:37:56 +0200 x86/alternatives: Remove the return value of text_poke_*() The return value of text_poke_early() and text_poke_bp() is useless. Remove it. Signed-off-by: Nadav Amit Signed-off-by: Rick Edgecombe Signed-off-by: Peter Zijlstra (Intel) Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Kees Cook Cc: Linus Torvalds Cc: Masami Hiramatsu Cc: Rik van Riel Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/20190426001143.4983-14-namit@vmware.com Signed-off-by: Ingo Molnar --- arch/x86/include/asm/text-patching.h | 4 ++-- arch/x86/kernel/alternative.c | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/arch/x86/include/asm/text-patching.h b/arch/x86/include/asm/text-patching.h index a75eed841eed..c90678fd391a 100644 --- a/arch/x86/include/asm/text-patching.h +++ b/arch/x86/include/asm/text-patching.h @@ -18,7 +18,7 @@ static inline void apply_paravirt(struct paravirt_patch_site *start, #define __parainstructions_end NULL #endif -extern void *text_poke_early(void *addr, const void *opcode, size_t len); +extern void text_poke_early(void *addr, const void *opcode, size_t len); /* * Clear and restore the kernel write-protection flag on the local CPU. @@ -37,7 +37,7 @@ extern void *text_poke_early(void *addr, const void *opcode, size_t len); extern void *text_poke(void *addr, const void *opcode, size_t len); extern void *text_poke_kgdb(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 void text_poke_bp(void *addr, const void *opcode, size_t len, void *handler); extern int after_bootmem; extern __ro_after_init struct mm_struct *poking_mm; extern __ro_after_init unsigned long poking_addr; diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 3d2b6b6fb20c..18f959975ea0 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -265,7 +265,7 @@ static void __init_or_module add_nops(void *insns, unsigned int len) extern struct alt_instr __alt_instructions[], __alt_instructions_end[]; extern s32 __smp_locks[], __smp_locks_end[]; -void *text_poke_early(void *addr, const void *opcode, size_t len); +void text_poke_early(void *addr, const void *opcode, size_t len); /* * Are we looking at a near JMP with a 1 or 4-byte displacement. @@ -667,8 +667,8 @@ void __init alternative_instructions(void) * instructions. And on the local CPU you need to be protected again NMI or MCE * handlers seeing an inconsistent instruction while you patch. */ -void *__init_or_module text_poke_early(void *addr, const void *opcode, - size_t len) +void __init_or_module text_poke_early(void *addr, const void *opcode, + size_t len) { unsigned long flags; @@ -691,7 +691,6 @@ void *__init_or_module text_poke_early(void *addr, const void *opcode, * that causes hangs on some VIA CPUs. */ } - return addr; } __ro_after_init struct mm_struct *poking_mm; @@ -893,7 +892,7 @@ NOKPROBE_SYMBOL(poke_int3_handler); * replacing opcode * - sync cores */ -void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) +void text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) { unsigned char int3 = 0xcc; @@ -935,7 +934,5 @@ void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) * the writing of the new instruction. */ bp_patching_in_progress = false; - - return addr; }