Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754759AbbBTOHI (ORCPT ); Fri, 20 Feb 2015 09:07:08 -0500 Received: from cantor2.suse.de ([195.135.220.15]:37607 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754187AbbBTOHH (ORCPT ); Fri, 20 Feb 2015 09:07:07 -0500 From: Petr Mladek To: Ingo Molnar , Masami Hiramatsu Cc: "David S. Miller" , Anil S Keshavamurthy , Ananth NMavinakayanahalli , Frederic Weisbecker , Steven Rostedt , Jiri Kosina , linux-kernel@vger.kernel.org, Petr Mladek Subject: [PATCH v3 0/2] kprobes/x86: Fix up interaction between kprobes code recovery and ftrace Date: Fri, 20 Feb 2015 15:07:28 +0100 Message-Id: <1424441250-27146-1-git-send-email-pmladek@suse.cz> X-Mailer: git-send-email 1.8.5.6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The code affected by ftrace was not properly recovered in Kprobe checks. Also the address returned by ftrace can be used for a consistency check. This version is based on the feedback for the separate patches, see https://lkml.org/lkml/2015/2/20/91 and https://lkml.org/lkml/2015/2/20/90 Changes against v2: + avoid using MCOUNT_INSN_SIZE that is available only with CONFIG_FUNCTION_TRACER enabled + use WARN_ON() instead of BUG_ON() and correctly handle the situation when Kprobe is not able to recover the code Changes against v1: + always use 5-byte NOP for ftrace location + fix indentation of the touched comment Petr Mladek (2): kprobes/x86: Use 5-byte NOP when the code might be modified by ftrace kprobes/x86: Check for invalid ftrace location in __recover_probed_insn() arch/x86/kernel/kprobes/core.c | 54 +++++++++++++++++++++++++++++++----------- arch/x86/kernel/kprobes/opt.c | 2 ++ 2 files changed, 42 insertions(+), 14 deletions(-) -- 1.8.5.6