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] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZuQRVJ1VwUoVj6DD@krava>
Date: Fri, 13 Sep 2024 12:17:56 +0200
From: Jiri Olsa <olsajiri@...il.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Jiri Olsa <olsajiri@...il.com>, Peter Zijlstra <peterz@...radead.org>,
	Alexei Starovoitov <ast@...nel.org>,
	Daniel Borkmann <daniel@...earbox.net>,
	Andrii Nakryiko <andrii@...nel.org>, bpf@...r.kernel.org,
	Martin KaFai Lau <kafai@...com>, Song Liu <songliubraving@...com>,
	Yonghong Song <yhs@...com>,
	John Fastabend <john.fastabend@...il.com>,
	KP Singh <kpsingh@...omium.org>,
	Stanislav Fomichev <sdf@...gle.com>, Hao Luo <haoluo@...gle.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Masami Hiramatsu <mhiramat@...nel.org>,
	linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCHv3 1/7] uprobe: Add support for session consumer

On Fri, Sep 13, 2024 at 11:32:01AM +0200, Oleg Nesterov wrote:
> On 09/13, Jiri Olsa wrote:
> >
> > On Thu, Sep 12, 2024 at 06:35:39PM +0200, Oleg Nesterov wrote:
> > > >  	list_for_each_entry_srcu(uc, &uprobe->consumers, cons_node,
> > > >  				 srcu_read_lock_held(&uprobes_srcu)) {
> > > > +		/*
> > > > +		 * If we don't find return consumer, it means uprobe consumer
> > > > +		 * was added after we hit uprobe and return consumer did not
> > > > +		 * get registered in which case we call the ret_handler only
> > > > +		 * if it's not session consumer.
> > > > +		 */
> > > > +		ric = return_consumer_find(ri, &iter, uc->id);
> > > > +		if (!ric && uc->session)
> > > > +			continue;
> > > >  		if (uc->ret_handler)
> > > > -			uc->ret_handler(uc, ri->func, regs);
> > > > +			uc->ret_handler(uc, ri->func, regs, ric ? &ric->cookie : NULL);
> > >
> > > So why do we need the new uc->session member and the uc->session above ?
> > >
> > > If return_consumer_find() returns NULL, uc->ret_handler(..., NULL) can handle
> > > this case itself?
> >
> > I tried to explain that in the comment above.. we do not want to
> > execute session ret_handler at all in this case, because its entry
> > counterpart did not run
> 
> I understand, but the session ret_handler(..., __u64 *data) can simply do
> 
> 	// my ->handler() didn't run or it didn't return 0
> 	if (!data)
> 		return;
> 
> at the start?

I see, that's actualy the only usage of the 'session' flag, so we could
get rid of it and we'd do above check in uprobe_multi layer.. good idea

thanks,
jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ