lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5930027.DvuYhMxLoT@7950hx>
Date: Wed, 15 Oct 2025 15:25:18 +0800
From: Menglong Dong <menglong.dong@...ux.dev>
To: Menglong Dong <menglong8.dong@...il.com>,
 Masami Hiramatsu <mhiramat@...nel.org>
Cc: rostedt@...dmis.org, mathieu.desnoyers@...icios.com, jiang.biao@...ux.dev,
 linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
 bpf@...r.kernel.org
Subject: Re: [PATCH v2 1/2] tracing: fprobe: optimization for entry only case

On 2025/10/14 22:51, Masami Hiramatsu wrote:
> Hi Menglong,
> 
> I remember why I haven't implement this.
> 
> On Fri, 10 Oct 2025 11:38:46 +0800
> Menglong Dong <menglong8.dong@...il.com> wrote:
> 
> > +
> > +static struct ftrace_ops fprobe_ftrace_ops = {
> > +	.func	= fprobe_ftrace_entry,
> > +	.flags	= FTRACE_OPS_FL_SAVE_REGS,
> 
> Actually, this flag is the problem. This can fail fprobe on architecture
> which does not support CONFIG_DYNAMIC_FTRACE_WITH_REGS (e.g. arm64, riscv)
> 
>  * SAVE_REGS - The ftrace_ops wants regs saved at each function called
>  *            and passed to the callback. If this flag is set, but the
>  *            architecture does not support passing regs
>  *            (CONFIG_DYNAMIC_FTRACE_WITH_REGS is not defined), then the
>  *            ftrace_ops will fail to register, unless the next flag
>  *            is set.
> 
> fgraph has a special entry code for saving ftrace_regs.
> So at least we need to fail back to fgraph if arch does not
> support CONFIG_DYNAMIC_FTRACE_WITH_REGS.

Ah, I have be working on x86_64 and didn't notice it. You are
right, we do need fallback if CONFIG_DYNAMIC_FTRACE_WITH_REGS
not supported. I'll send a V4 later.

BTW, is the FTRACE_OPS_FL_SAVE_REGS necessary here? I guess
not all architectures save the function argument regs in
fentry_caller() like x86_64, that's why we need it here :/

Thanks!
Menglong Dong

> 
> Thank you,
> 
> 





Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ