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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 24 Feb 2022 14:46:31 -0800
From:   Josh Poimboeuf <jpoimboe@...hat.com>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     Masami Hiramatsu <mhiramat@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>, x86@...nel.org,
        joao@...rdrivepizza.com, hjl.tools@...il.com,
        andrew.cooper3@...rix.com, linux-kernel@...r.kernel.org,
        ndesaulniers@...gle.com, keescook@...omium.org,
        samitolvanen@...gle.com, mark.rutland@....com,
        alyssa.milburn@...el.com, mbenes@...e.cz,
        alexei.starovoitov@...il.com
Subject: Re: [PATCH v2 12/39] x86/ibt,ftrace: Search for __fentry__ location

On Thu, Feb 24, 2022 at 11:01:30AM -0500, Steven Rostedt wrote:
> On Thu, 24 Feb 2022 10:58:47 -0500
> Steven Rostedt <rostedt@...dmis.org> wrote:
> 
> > On Fri, 25 Feb 2022 00:55:20 +0900
> > Masami Hiramatsu <mhiramat@...nel.org> wrote:
> > 
> > > >  unsigned long ftrace_location(unsigned long ip)
> > > >  {
> > > > -	return ftrace_location_range(ip, ip);
> > > > +	struct dyn_ftrace *rec;
> > > > +	unsigned long offset;
> > > > +	unsigned long size;
> > > > +
> > > > +	rec = lookup_rec(ip, ip);
> > > > +	if (!rec) {
> > > > +		if (!kallsyms_lookup_size_offset(ip, &size, &offset))
> > > > +			goto out;
> > > > +
> > > > +		if (!offset)    
> > > 
> > > Isn't this 'if (offset)' ?  
> > 
> > No, the point to only look for the fentry location if the ip passed in
> > points to the start of the function. IOW, +0 offset.
> > 
> 
> I do agree with Masami that it is confusing. Please add a comment:
> 
> 		/* Search the entire function if ip is the start of the function */
> 		if (!offset)
> 			[..]
> 
> -- Steve
> 
> > 
> > 
> > >   
> > > > +			rec = lookup_rec(ip - offset, (ip - offset) + size);

If 'offset' is zero then why the math here?      ^^^^^^^^^^^   ^^^^^^^^^^^
-- 
Josh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ