From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754002AbbCILEx (ORCPT ); Mon, 9 Mar 2015 07:04:53 -0400 Received: from collab.rosalab.ru ([195.19.76.181]:55001 "EHLO collab.rosalab.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752765AbbCILEr (ORCPT ); Mon, 9 Mar 2015 07:04:47 -0400 Message-ID: <54FD7E4D.4080504@rosalab.ru> Date: Mon, 09 Mar 2015 14:04:45 +0300 From: Eugene Shatokhin Organization: ROSA User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Masami Hiramatsu CC: linux-kernel@vger.kernel.org Subject: Re: Kprobes: pre-handler with interrupts enabled - is it possible? References: <54EB4194.7040901@rosalab.ru> <54EBF464.7020704@hitachi.com> <54EC1487.4020902@rosalab.ru> <54EC5160.7090400@hitachi.com> In-Reply-To: <54EC5160.7090400@hitachi.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I am now working on an example to see if what I suggested earlier is possible. During this, I encountered a problem in Kprobes on x86 that prevents placing them on the insns with %rip-relative addressing. register_kprobe() returns -EINVAL in such cases because __copy_instruction() returns 0 (arch/x86/kernel/kprobes/core.c). The latter is due to the second call to kernel_insn_init() which zeroes the struct insn instance, including insn.length. I will send a patch shortly, please consider it for inclusion. Regards, Eugene -- Eugene Shatokhin, ROSA www.rosalab.com