From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x225sbCox7AjvgvStO7nMX1MY6gtdedjCThdf/PqIzsy+xtK2dHcCbiueoIH2TqWKkQx1oR96 ARC-Seal: i=1; a=rsa-sha256; t=1516611262; cv=none; d=google.com; s=arc-20160816; b=aWkKqg/nv8eowaa1DszpllonaahGfJGpjtkCioHL93wcJVA4acVBW/l99bQMxvbXip ooZBHjaJfaJSZQyDvUr8m6GXTzmkdj0+WxJ/8hY8AXPWbu56KANpqO8L4HYiT5MEERxo galOAOLl1ru8O+Za3t7+i8VkEXvhG+Yiys2e13SM4pMhRINRG0yzaq/W/EZW3BOs3sSM QU4D6Mn0yft+WiUW0y4On31UmBa9TlMPRSHRBQE/YHCOE/9tFGTHInCNryNOdE4WUE7m rveI9s+kYBAdSsGlZeuO782ibZQ4N3wsmTaiN+J7cMgCxDqYa2cSu/LZmguvVDgYcYDo /zSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=tzHCERdXSu3ZNK2l/wN3sLEyncHfRPLvpqGH0J0Xubo=; b=GwIk3qjG9vY5eJPkyocCieebIA7t63DwzDU4KyWq3CYop0mqCoKQnvxnBi6Bgg/vTs mmXiCC/VanP0Y+VM6Cgp+yuEF2pNuyqdaLtuzBGxI6V/n6xlPQrbyovAmw433KAu8CaK VTxLD4QjiPIAwjNUsG/+D5y25XQ/ggI9uzUr9kT4P/XrLoHNsYGtWjxmt3azyeUUapea KSOWjuAZDdu2Fa0wKdeFw41DFyZnFpuCNrkbA9bSkFDx9ZQzX1GKRC7/d0X6ElbESUZS phLCE3/oELguEC/OZcrxKzUbE+flHL/WZKjuak/TG0/fnaSj2KwztkRIzmqJtX/BHPO3 NfeA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masami Hiramatsu , Thomas Gleixner , David Woodhouse , Andi Kleen , Peter Zijlstra , Ananth N Mavinakayanahalli , Arjan van de Ven , Greg Kroah-Hartman Subject: [PATCH 4.14 83/89] kprobes/x86: Blacklist indirect thunk functions for kprobes Date: Mon, 22 Jan 2018 09:46:03 +0100 Message-Id: <20180122084002.790927692@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083954.683903493@linuxfoundation.org> References: <20180122083954.683903493@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590281444885539021?= X-GMAIL-MSGID: =?utf-8?q?1590282170664578812?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Masami Hiramatsu commit c1804a236894ecc942da7dc6c5abe209e56cba93 upstream. Mark __x86_indirect_thunk_* functions as blacklist for kprobes because those functions can be called from anywhere in the kernel including blacklist functions of kprobes. Signed-off-by: Masami Hiramatsu Signed-off-by: Thomas Gleixner Acked-by: David Woodhouse Cc: Andi Kleen Cc: Peter Zijlstra Cc: Ananth N Mavinakayanahalli Cc: Arjan van de Ven Cc: Greg Kroah-Hartman Link: https://lkml.kernel.org/r/151629209111.10241.5444852823378068683.stgit@devbox Signed-off-by: Greg Kroah-Hartman --- arch/x86/lib/retpoline.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/arch/x86/lib/retpoline.S +++ b/arch/x86/lib/retpoline.S @@ -25,7 +25,8 @@ ENDPROC(__x86_indirect_thunk_\reg) * than one per register with the correct names. So we do it * the simple and nasty way... */ -#define EXPORT_THUNK(reg) EXPORT_SYMBOL(__x86_indirect_thunk_ ## reg) +#define __EXPORT_THUNK(sym) _ASM_NOKPROBE(sym); EXPORT_SYMBOL(sym) +#define EXPORT_THUNK(reg) __EXPORT_THUNK(__x86_indirect_thunk_ ## reg) #define GENERATE_THUNK(reg) THUNK reg ; EXPORT_THUNK(reg) GENERATE_THUNK(_ASM_AX)