Received: by 10.223.148.5 with SMTP id 5csp7314501wrq; Thu, 18 Jan 2018 04:03:46 -0800 (PST) X-Google-Smtp-Source: ACJfBouszKmC49nyGSjIQGNmcy0usbxeGRI3TLm5jhyRq652hKvOJHmGhaF/9j2PmcsYdj0yaG0j X-Received: by 10.98.217.28 with SMTP id s28mr33087064pfg.69.1516277026421; Thu, 18 Jan 2018 04:03:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516277026; cv=none; d=google.com; s=arc-20160816; b=cWb4ZR8/x0SsQtuuTZSPsGg+/rMXhzkojZxXio2wqw7rQ2WoUxMMvfXI0IkDGWt6M9 XMlPuHlpk1vxJENYsJWls8fVCk/2ywo9SeKckvPasVDtJ+4ul604q0Cb3waY9IVVEHhM L+grLhWIMgTuGZ4U0c7FmXgXq9OXtwRHp0Z2HzQwyxmrYz5uqwJxdXlsu01hbdPBCxbZ Eyl7fD5bwgRC24vFCYmS4bUkQ1Iwhf23gx0VXXm7G7E7wSi7phaboGfAiHQj1H9xBDSk GEFD3x1YzAl70vj630/UZtGKgYcDjTC6kQfa3rczguNAKadd+DGzqK8xRydgAHkYaHmh /l5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dmarc-filter:arc-authentication-results; bh=ttbYeHNj+Ii8S1962GdBlwvYc793fLqcf9F/a680ydY=; b=syC8Vrv0cXMcFDlXNQjbXY4m6JZLCft+G9tyYtSysMv1RlyUo3Lm/eCD9xlpIcvxeI 5v2QPOoVzoCMUB8ycTZGdeM5Wn2h7WChhAhD/wUywP6D26dqGjB1YCRULcl0Aa0Nw1IZ eLYd9nTkggLThuq5Cpip/HPWX1Cbx+B1D9J3itbTk63iRaCN08hJ4KSZW7kSd6X49svz r4pWnfhXaj3lt6ILMSRMU+NCLcCFVI3TFRvkDn3eFNNhwl1edO1qH9FZpOvz+H7Z0mTJ +Y0N+vGyjmeWohrTBIliA9JY8LvIaSMAqOkti3huMIafX+MQ/VnHbLjwlwa1HYnXkmzV zQMg== 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 c80si6590983pfl.173.2018.01.18.04.03.32; Thu, 18 Jan 2018 04:03:46 -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 S932403AbeARMCm (ORCPT + 99 others); Thu, 18 Jan 2018 07:02:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:40232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931AbeARMCN (ORCPT ); Thu, 18 Jan 2018 07:02:13 -0500 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0C74D20837; Thu, 18 Jan 2018 12:02:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0C74D20837 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=mhiramat@kernel.org From: Masami Hiramatsu To: Ingo Molnar , David Woodhouse Cc: Masami Hiramatsu , linux-kernel@vger.kernel.org, Andi Kleen , Greg Kroah-Hartman , Arjan van de Ven , Peter Zijlstra , Ananth N Mavinakayanahalli , Thomas Gleixner , "H . Peter Anvin" Subject: [PATCH v1 tip/master 2/3] kprobes/x86: Blacklist indirect thunk functions for kprobes Date: Thu, 18 Jan 2018 21:01:48 +0900 Message-Id: <151627690859.24682.1058211027484209346.stgit@devbox> X-Mailer: git-send-email 2.13.6 In-Reply-To: <151627684798.24682.2979775081582774869.stgit@devbox> References: <151627684798.24682.2979775081582774869.stgit@devbox> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/x86/lib/retpoline.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S index cb45c6cb465f..9d964f6795b8 100644 --- 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)