RE: x86/kprobes: kretprobe fails to triggered if kprobe at function entry is not optimized (trigger by int3 breakpoint)
From: Eddy_Wu@xxxxxxxxxxxxxx
Date: Wed Aug 26 2020 - 09:36:37 EST
> -----Original Message-----
> From: peterz@xxxxxxxxxxxxx <peterz@xxxxxxxxxxxxx>
> Sent: Wednesday, August 26, 2020 6:26 PM
> To: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
> Cc: Eddy Wu (RD-TW) <Eddy_Wu@xxxxxxxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx; x86@xxxxxxxxxx
> Subject: Re: x86/kprobes: kretprobe fails to triggered if kprobe at function entry is not optimized (trigger by int3 breakpoint)
>
> On Wed, Aug 26, 2020 at 07:00:41PM +0900, Masami Hiramatsu wrote:
> > Of course, this doesn't solve the llist_del_first() contention in the
> > pre_kretprobe_handler(). So anyway we need a lock for per-probe llist
> > (if I understand llist.h comment correctly.)
>
> Bah, lemme think about that. Kprobes really shouldn't be using locks :/
Maybe we can have per-cpu free list for retprobe_instance?
This ensure we only have one user requesting free instance at a time, given that pre_kretprobe_handler() wont recursive.
We may be wasting memory if target function perfer some cpu though.
TREND MICRO EMAIL NOTICE
The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.
For details about what personal information we collect and why, please see our Privacy Notice on our website at: Read privacy policy<http://www.trendmicro.com/privacy>