From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: ACJfBouU5mSsVLrOUO7ls2L3Bb1s+cuLp1uCyK1R7OmU/0/L9gQ3aMekIxuwFAjUVhQFEseRNJyo ARC-Seal: i=1; a=rsa-sha256; t=1516292056; cv=none; d=google.com; s=arc-20160816; b=bprvI5ziGrwSXmZ8EygZrhsgxlNIaZK5i86Tibb80MixCnEd327Ke7uZKWuZ9MJ8l5 JwTd6jOXubyTtF47EC9lYhRAjxl17JwhhrVNkEDSk4x7OfgF6aShYl/sAoB0ZQa1qqhR eb09ynNrZfRtC9m0HR0YOycSka5HjlAkPhsxOnJdNicG5PCj9nVDr2nHccWw4Dg7gV6E LMEyM66dkHR+x2Ekr8zoElpfn7SsY1WlhxtFUFsloIhxN2WXjfyHOb3mvOEQndjARWiE wV2nSoED+YiJYVVfTEAQHcRruespqIUn8oVyEkCymMO1PfDiLMJKVaQv3bsVnjZzE7Xy vkDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:user-agent:message-id:date :subject:cc:to:from:dmarc-filter:arc-authentication-results; bh=vLobewux9e5eBsVtQ8omCH4VwQKm30t9tcVdyZuluhI=; b=TS//+OaPDBJQakzkLpCjEpO443qss0exO23jRfXuCfbjHOAr9EbTwcqwWUKP5abllA 3lsm+5aw2DkYwEuYAZ5eEJ2IEftcWti49Svudzq3xNzHdQZcOFsOX0c7SlO0IOvP1Fn6 UReTnNMbeuqakVcUPeU/M609ExrNeJY0sIM/AzfKu1+QSYDZfD4Lm9D1Ls+LnhL79pdV AcGwCDwI7b6rGFSK7x2L9X2jrNWVsQq7nJhT8i8cjukWa5ySU2eCz6qwC/VnKVFLZYoQ b8jDDY1t9G3oftF9VLNYXpZtxKPSzNZtiRKXZfYDpF4BkZLZGXaJEcYDdHVxg8YhkYt4 BV/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of mhiramat@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=mhiramat@kernel.org Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of mhiramat@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=mhiramat@kernel.org DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A8FD620836 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 v2 tip/master 0/3] kprobes/x86: retpoline: Fix kprobes for retpoline Date: Fri, 19 Jan 2018 01:13:57 +0900 Message-Id: <151629203720.10241.17490679760505352230.stgit@devbox> X-Mailer: git-send-email 2.13.6 User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1589931539308254743?= X-GMAIL-MSGID: =?utf-8?q?1589947459671366735?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: Hi, This is the 2nd version of the series to fix kprobes issues on the kernel with CONFIG_RETPOLINE=y. - [1/3]: This introduces __x86_indirect_thunk_* boundary symbols so that kprobes easily identify those functions. - [2/3]: Mark __x86_indirect_thunk_* as blacklisted function for kprobes, since it can be called from other blacklisted functions. - [3/3]: Check jmp instructions in the probe target function whether it jumps into the __x86_indirect_thunk_*, because it is equal to an indirect jump instruction. In this version, just [1/3] has been changed according to David Woodhouse's comment. [1/3]: Consolidate .text.__x86.indirect_thunk.* sections to .text.__x86.indirect_thunk section. Thank you, --- Masami Hiramatsu (3): retpoline: Introduce start/end markers of indirect thunk kprobes/x86: Blacklist indirect thunk functions for kprobes kprobes/x86: Disable optimizing on the function jumps to indirect thunk arch/x86/include/asm/nospec-branch.h | 3 +++ arch/x86/kernel/kprobes/opt.c | 23 ++++++++++++++++++++++- arch/x86/kernel/vmlinux.lds.S | 6 ++++++ arch/x86/lib/retpoline.S | 5 +++-- 4 files changed, 34 insertions(+), 3 deletions(-) -- Masami Hiramatsu (Linaro)