Received: by 10.223.176.46 with SMTP id f43csp2653618wra; Mon, 22 Jan 2018 00:58:31 -0800 (PST) X-Google-Smtp-Source: AH8x225GnPuCNywXyXR65EdiY87blsWew6If0WR2uyK/FVsvuHo77Du1pbO7ldtmAW2mUxEPd8H3 X-Received: by 10.99.51.203 with SMTP id z194mr5639381pgz.217.1516611511502; Mon, 22 Jan 2018 00:58:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516611511; cv=none; d=google.com; s=arc-20160816; b=abgd+DYNULMgUaukohTDcMm80/aQyyIF6Rn7KnYXgBfOBObWG2huM6D89o1bcNIX+d W6mxSkg1WuhK4n0JYJzVBdlRff1MR48okbJt+AE1QzqzxmTB6dSIaPaaKyrPCBroqJng tT1A+3jY6MnkhW0LE51OLSMBUFpIOzfViyY+g/kTGyaTTSKIFr089AxlSC1f3bNzxLh0 L61/FG+5qpRMpHlfzcJJPafUEWQ222yYYlentKaRtvIXWJOcg96HOw0/0Zpf2fkJQwvm DLJ6qvBiz7luM96IROxrdzg4JqY69RgpN82aTwOAGa/7uw0vUsjVrrUF1sDiPYUDlnQA bCfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=tzHCERdXSu3ZNK2l/wN3sLEyncHfRPLvpqGH0J0Xubo=; b=iAqmXNUFRld3Oq2S5qAD4q8AKfvOkbgIz2CXR8SQGFiYFqdhu1Tr8QZq9oNLCa5RIA pdcUdtZGI2sM7ZxtCTcJ/neBYrZTKLddRph/ojJBDftgFHw29SXJ0TJ+2YdD+I/Et1oI +DLXTpNwSuz3CW4gkPKo6aeth9TIK4COoySd5wfkAnNP/5Vl/oF8K1rvk9I4stkHG3GJ TX0tyGxOhEpRPi0LlttGj+x81trmKI8wkBVqs3072inpH/D/FeT1/vgnn67tSjak1UQv E+uSokhy2Ys2MfNwLPNzMtZxcxoRrT793K2hWYVP0vNwMm08UD9Isx0CTusbRtWYRgVi 8cfQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k68si13606501pfh.89.2018.01.22.00.58.17; Mon, 22 Jan 2018 00:58:31 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753787AbeAVIyY (ORCPT + 99 others); Mon, 22 Jan 2018 03:54:24 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:34232 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753776AbeAVIyV (ORCPT ); Mon, 22 Jan 2018 03:54:21 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 5E167F39; Mon, 22 Jan 2018 08:54:20 +0000 (UTC) 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)