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: <20150716232128.1a887a9f@grimm.local.home>
Date:	Thu, 16 Jul 2015 23:21:28 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	AKASHI Takahiro <takahiro.akashi@...aro.org>
Cc:	Jungseok Lee <jungseoklee85@...il.com>, catalin.marinas@....com,
	will.deacon@....com, olof@...om.net, broonie@...nel.org,
	david.griego@...aro.org, linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC 2/3] arm64: refactor save_stack_trace()

On Fri, 17 Jul 2015 11:49:52 +0900
AKASHI Takahiro <takahiro.akashi@...aro.org> wrote:

> > -
> > -	if (using_ftrace_ops_list_func())
> > -		max_stack_trace.skip = 4;
> > -	else
> > -		max_stack_trace.skip = 3;
> > +	max_stack_trace.skip = 3;
> 
> I don't think this last line is necessary because we will skip all
> the functions anyway below:

I put this back more as an optimization as it is already known that it
takes at least three calls to get to this point. Unless of course gcc
decides to inline them. But currently I don't see that.

> 
> >   	save_stack_trace(&max_stack_trace);
> >
> > -	/*
> > -	 * Add the passed in ip from the function tracer.
> > -	 * Searching for this on the stack will skip over
> > -	 * most of the overhead from the stack tracer itself.
> > -	 */
> > -	stack_dump_trace[0] = ip;
> > -	max_stack_trace.nr_entries++;
> > +	/* Skip over the overhead of the stack tracer itself */
> > +	for (i = 0; i < max_stack_trace.nr_entries; i++) {
> > +		if (stack_dump_trace[i] == ip)
> > +			break;
> > +	}
> 
> here. Now "i" indicates the start point, excepting tracer functions,
> and "x" will eventually represent the exact number of functions
> that we are interested in after searching the stack.
> 
> To calc "stack_max_size" correctly, we should change the line:
>      if (unlikely(tracer_frame) && i == 1) {
> to
>      if (unlikely(tracer_frame)) {

Good catch, I'll fix that!

-- Steve

> 
> With these two changes applied, the issues Jungseok mentioned will be
> fixed.
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ