Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1787692imu; Thu, 17 Jan 2019 03:18:43 -0800 (PST) X-Google-Smtp-Source: ALg8bN7+tTeWtYYcX/D+gC8jetzT0Qz4ucwBCV5aa21hdJCdDPa/ZY9Jkwgx1fIqO47SK8dTpyDA X-Received: by 2002:a17:902:28e9:: with SMTP id f96mr14589446plb.169.1547723923418; Thu, 17 Jan 2019 03:18:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547723923; cv=none; d=google.com; s=arc-20160816; b=Zx9BiVyvwFCkU3Ms2HAiEwexzRnkdwcm8jRx4m3bEnbl5UfnT8KVlezODmzKoXoLEH y0HHe4d1qx6nnEmqgDgTtUhHl+On1zhqJLweqNUFCzxg5072k6Nzf2/sQP0DmP+X3K8d +oDRDx0kR+fijqhsdSdeZKffEYWaf2IfXGKxcrTkkaChmzJoczPTq/waw3lNFNgms6DB V47Ulh0hW9HE6UlmPDp/SWdUpZs8S2BYvleZUiQk+QbdO1cAaf54nygbsSTFP7vrmoqk 1/NLCJegy6hUBSgIl3BFYH9kXPwtA8piR2RekPywfPtVgcxjPOtmzu3WHFTlEaYOW3VQ NlRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=se2UgweWDUv6UvpNReMwED+7UCj9/063SvA/PxiU/I8=; b=jOVnOJV5k9KC/J15uCShjtWM4IrjII8g5dNENeXDix5VVhiiv7nvOme8i8p3sPi0px vhXXFMxBilHI/I49iu28XioO0uSFPNWDkhP+HJgk1IgdysD/nnVn4Y9FIDFsyAIvi9hf b1xOtA51Vrs2OzjPJI7qiDpvvzfs4odUqUT9witEzQRoegfcs8zDOvnQLMbAnV4SzlbK Uu93TqscxOT4vVMRY/4o8M+xtNNk+LbbPxCdvXNzSTX6yljrQVO3i4bxAdrW37u4l68o P4reT5Zg5kbI/kWtpwLtpdCauFYCBA24+IhgEocy721vr/1nn83Vo/2cbc9XFgB/IwoQ wYIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l5si1466073pls.423.2019.01.17.03.18.26; Thu, 17 Jan 2019 03:18:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730252AbfAQAdq (ORCPT + 99 others); Wed, 16 Jan 2019 19:33:46 -0500 Received: from mga05.intel.com ([192.55.52.43]:42206 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729999AbfAQAdk (ORCPT ); Wed, 16 Jan 2019 19:33:40 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2019 16:33:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,488,1539673200"; d="scan'208";a="292166048" Received: from rpedgeco-desk5.jf.intel.com ([10.54.75.79]) by orsmga005.jf.intel.com with ESMTP; 16 Jan 2019 16:33:36 -0800 From: Rick Edgecombe To: Andy Lutomirski , Ingo Molnar Cc: linux-kernel@vger.kernel.org, x86@kernel.org, hpa@zytor.com, Thomas Gleixner , Borislav Petkov , Nadav Amit , Dave Hansen , Peter Zijlstra , linux_dti@icloud.com, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, akpm@linux-foundation.org, kernel-hardening@lists.openwall.com, linux-mm@kvack.org, will.deacon@arm.com, ard.biesheuvel@linaro.org, kristen@linux.intel.com, deneen.t.dock@intel.com, Nadav Amit , Kees Cook , Dave Hansen , Masami Hiramatsu , Rick Edgecombe Subject: [PATCH 12/17] x86/alternative: Remove the return value of text_poke_*() Date: Wed, 16 Jan 2019 16:32:54 -0800 Message-Id: <20190117003259.23141-13-rick.p.edgecombe@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190117003259.23141-1-rick.p.edgecombe@intel.com> References: <20190117003259.23141-1-rick.p.edgecombe@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nadav Amit The return value of text_poke_early() and text_poke_bp() is useless. Remove it. Cc: Andy Lutomirski Cc: Kees Cook Cc: Peter Zijlstra Cc: Dave Hansen Cc: Masami Hiramatsu Signed-off-by: Nadav Amit Signed-off-by: Rick Edgecombe --- 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 18415e3b6000..2740ad2c6f21 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -264,7 +264,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. @@ -666,8 +666,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; @@ -690,7 +690,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 @@ int poke_int3_handler(struct pt_regs *regs) * 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; } -- 2.17.1