This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Re: Re: Re: [PATCH -tip v6 06/22] [BUGFIX] x86: Prohibit probing on memcpy/memset
- From: Masami Hiramatsu <masami dot hiramatsu dot pt at hitachi dot com>
- To: Jovi Zhangwei <jovi dot zhangwei at gmail dot com>
- Cc: Ingo Molnar <mingo at kernel dot org>, linux-arch at vger dot kernel dot org, Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>, Sandeepa Prabhu <sandeepa dot prabhu at linaro dot org>, x86 at kernel dot org, lkml <linux-kernel at vger dot kernel dot org>, "Steven Rostedt (Red Hat)" <rostedt at goodmis dot org>, Ingo Molnar <mingo at redhat dot com>, systemtap at sourceware dot org, "H. Peter Anvin" <hpa at zytor dot com>, Thomas Gleixner <tglx at linutronix dot de>, "David S. Miller" <davem at davemloft dot net>
- Date: Tue, 24 Dec 2013 17:32:13 +0900
- Subject: Re: Re: Re: Re: [PATCH -tip v6 06/22] [BUGFIX] x86: Prohibit probing on memcpy/memset
- Authentication-results: sourceware.org; auth=none
- References: <20131219090353 dot 14309 dot 15496 dot stgit at kbuild-fedora dot novalocal> <20131219090409 dot 14309 dot 25677 dot stgit at kbuild-fedora dot novalocal> <CAGdX0WFKYHqXrVQ6LBw0YgH_H6cP=LZVCBe1iOvEXsHQPD8Zmg at mail dot gmail dot com> <52B3AD7D dot 2020104 at hitachi dot com> <CAGdX0WENxTPhFDtcEW6LFhk1SNZc6mEK+JsCDOJmfK8_PS1rxg at mail dot gmail dot com> <52B3CABE dot 1080903 at hitachi dot com> <CAGdX0WEev84sOyu-uzkDOmQFi_=mza7cPzyC0VkRZe0fD_1+jQ at mail dot gmail dot com> <52B40C00 dot 2060401 at hitachi dot com> <CAGdX0WECaJBSX29-+fC=0XLJfAh0JvFyLTW2V8yM616L45iCQQ at mail dot gmail dot com> <52B8178F dot 5020607 at hitachi dot com> <CAGdX0WEZue1fBtHw058HAmuCktkM+jyKdPfn0ZM2=fNAPfcJwA at mail dot gmail dot com>
(2013/12/24 15:39), Jovi Zhangwei wrote:
> On Mon, Dec 23, 2013 at 6:59 PM, Masami Hiramatsu
> <masami.hiramatsu.pt@hitachi.com> wrote:
>> (2013/12/23 13:51), Jovi Zhangwei wrote:
>>> On Fri, Dec 20, 2013 at 5:21 PM, Masami Hiramatsu
>>> <masami.hiramatsu.pt@hitachi.com> wrote:
>>>> (2013/12/20 17:31), Jovi Zhangwei wrote:
>>>>> On Fri, Dec 20, 2013 at 12:42 PM, Masami Hiramatsu
>>>>> <masami.hiramatsu.pt@hitachi.com> wrote:
>>>>>> (2013/12/20 12:07), Jovi Zhangwei wrote:
>>>>>>> On Fri, Dec 20, 2013 at 10:37 AM, Masami Hiramatsu
>>>>>>> <masami.hiramatsu.pt@hitachi.com> wrote:
>>>>>>>> Hi Jovi,
>>>>>>>>
>>>>>>>> (2013/12/19 18:37), Jovi Zhangwei wrote:
>>>>>>>>> Hi Masami,
>>>>>>>>>
>>>>>>>>> On Thu, Dec 19, 2013 at 5:04 PM, Masami Hiramatsu
>>>>>>>>> <masami.hiramatsu.pt@hitachi.com> wrote:
>>>>>>>>>> memcpy/memset functions are fundamental functions and
>>>>>>>>>> those are involved in kprobe's exception handling.
>>>>>>>>>> Prohibit probing on them to avoid kernel crash.
>>>>>>>>>>
>>>>>>>>> Would you please let me know the LKML link of that bugfix, I cannot
>>>>>>>>> find it in my LKML fold.
>>>>>>>>
>>>>>>>> Yeah, that was found in my testing environment.
>>>>>>>>
>>>>>>>>> No objection on this patch. :) just want to know more, It seems there
>>>>>>>>> have no problem to probe memcpy in my box, maybe I didn't hit the
>>>>>>>>> crash code path.
>>>>>>>>
>>>>>>>> Ah, I see. Originally the problem happened when I put a probe on
>>>>>>>> __memcpy. And it looks the instances of memcpy and __memcpy are
>>>>>>>> same on x86-64. Thus I decided to blacklist both. (memset/__memset too)
>>>>>>>> Have you ever tried to probe __memcpy on your box?
>>>>>>>>
>>>>>>> Hmm, still no crash, __memcpy and __memset are both tested.
>>>>>>>
>>>>>>> I use below kprobe related config:
>>>>>>>
>>>>>>> CONFIG_KPROBES=y
>>>>>>> CONFIG_JUMP_LABEL=y
>>>>>>> CONFIG_OPTPROBES=y
>>>>>>> CONFIG_KPROBES_ON_FTRACE=y
>>>>>>
>>>>>> Hmm, I've added some debugging options.
>>>>>>
>>>>>> CONFIG_SLUB_DEBUG=y
>>>>>> CONFIG_X86_DEBUGCTLMSR=y
>>>>>> CONFIG_PNP_DEBUG_MESSAGES=y
>>>>>> CONFIG_DEBUG_INFO=y
>>>>>> CONFIG_DEBUG_FS=y
>>>>>> CONFIG_DEBUG_KERNEL=y
>>>>>> CONFIG_DEBUG_STACK_USAGE=y
>>>>>> CONFIG_DEBUG_MEMORY_INIT=y
>>>>>> CONFIG_DEBUG_STACKOVERFLOW=y
>>>>>> CONFIG_DEBUG_SPINLOCK=y
>>>>>> CONFIG_DEBUG_MUTEXES=y
>>>>>> CONFIG_DEBUG_LOCK_ALLOC=y
>>>>>> CONFIG_DEBUG_LOCKDEP=y
>>>>>> CONFIG_DEBUG_BUGVERBOSE=y
>>>>>> CONFIG_DEBUG_RODATA=y
>>>>>> CONFIG_DEBUG_BOOT_PARAMS=y
>>>>>>
>>>>>> I guess some of them might cause it.
>>>>>>
>>>>> I recompiled the kernel with those config enabled, unfortunately still no crash,
>>>>> I tested on 3.13.0-rc4, a fedora kvm box.
>>>>
>>>> Hmm, it's very odd. I'm running 3.13.0-rc4 x86-64 on the fedora
>>>> kvm box too. here is the full of my kconfig.
>>>>
>>> That configuration is still working for me, no crash for memcpy kprobe test.
>>
>> Would you do __memcpy test? or memcpy test? I only had a crash on the
>> __memcpy(__memset).
>>
> Still no crash, use your kernel config.
> memcpy and __memcpy have same address in /proc/kallsyms.
>
> Looks like a interesting problem.
Agreed. In my case, those have same address, but only probing
__memcpy caused a kernel crash. I'm not sure why, but it is
safe to disable probing on it.
Thank you,
--
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com