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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250924171058.15fe8364253fb8c42d5f0197@kernel.org>
Date: Wed, 24 Sep 2025 17:10:58 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: menglong.dong@...ux.dev
Cc: Steven Rostedt <rostedt@...dmis.org>, Mathieu Desnoyers
 <mathieu.desnoyers@...icios.com>, linux-kernel@...r.kernel.org,
 linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] tracing: fprobe: Fix to remove recorded module
 addresses from filter

On Wed, 24 Sep 2025 11:49:39 +0800
menglong.dong@...ux.dev wrote:

> On 2025/9/24 08:26 Masami Hiramatsu (Google) <mhiramat@...nel.org> write:
> > From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
> > 
> > Even if there is a memory allocation failure in fprobe_addr_list_add(),
> > there is a partial list of module addresses. So remove the recorded
> > addresses from filter if exists.
> > This also removes the redundant ret local variable.
> > 
> > Fixes: a3dc2983ca7b ("tracing: fprobe: Cleanup fprobe hash when module unloading")
> > Signed-off-by: Masami Hiramatsu (Google) <mhiramat@...nel.org>
> > ---
> >  kernel/trace/fprobe.c |    7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> Hi, Masami. Should I send the V2 of the patch:
> 
>   tracing: fprobe: optimization for entry only case
> 
> after this series applied?

Yeah, I'll push this [2/2] to stable tonight. and
push [1/2] to probes/for-next too. I'll rebase probes/for-next
so that it will have both patch.

Thank you,

> 
> Thanks!
> Menglong Dong
> 
> > 
> > diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c
> > index 12ec194fdfed..95e43814b85b 100644
> > --- a/kernel/trace/fprobe.c
> > +++ b/kernel/trace/fprobe.c
> > @@ -434,8 +434,9 @@ static int fprobe_addr_list_add(struct fprobe_addr_list *alist, unsigned long ad
> >  {
> >  	unsigned long *addrs;
> >  
> > -	if (alist->index >= alist->size)
> > -		return -ENOMEM;
> > +	/* Previously we failed to expand the list. */
> > +	if (alist->index == alist->size)
> > +		return -ENOSPC;
> >  
> >  	alist->addrs[alist->index++] = addr;
> >  	if (alist->index < alist->size)
> > @@ -497,7 +498,7 @@ static int fprobe_module_callback(struct notifier_block *nb,
> >  	} while (node == ERR_PTR(-EAGAIN));
> >  	rhashtable_walk_exit(&iter);
> >  
> > -	if (alist.index < alist.size && alist.index > 0)
> > +	if (alist.index > 0)
> >  		ftrace_set_filter_ips(&fprobe_graph_ops.ops,
> >  				      alist.addrs, alist.index, 1, 0);
> >  	mutex_unlock(&fprobe_mutex);
> > 
> > 
> > 
> 
> 
> 
> 


-- 
Masami Hiramatsu (Google) <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ