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]
Date:	Wed, 3 Aug 2016 14:32:00 +0530
From:	Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com>
To:	Masami Hiramatsu <mhiramat@...nel.org>
Cc:	linux-kernel@...r.kernel.org, peterz@...radead.org,
	mingo@...hat.com, acme@...nel.org,
	alexander.shishkin@...ux.intel.com, wangnan0@...wei.com,
	hemant@...ux.vnet.ibm.com, naveen.n.rao@...ux.vnet.ibm.com,
	Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com>
Subject: Re: [PATCH] perf uprobe: Skip prologue if program compiled without
 optimization

Thanks Masami,

On Tuesday 02 August 2016 08:22 PM, Masami Hiramatsu wrote:
> On Mon,  1 Aug 2016 14:19:28 +0530
> Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com> wrote:
>
>> Function prologue prepares stack and registers before executing function
>> logic. When target program is compiled without optimization, function
>> parameter information is only valid after prologue. When we probe entrypc
>> of the function, and try to record function parameter, it contains
>> garbage value.
>>
[SNIP]
>> +
>> +	/* Only FUNC and FUNC@SRC are eligible. */
>> +	if (!pp->function || pp->line || pp->retprobe || pp->lazy_line ||
>> +	    pp->offset || pp->abs_address)
>> +		return;
>> +
>> +	/* Not interested in func parameter? */
>> +	if (!pf->pev->nargs)
>> +		return;
> Hmm, this is not enough, since perf-probe accepts registers and stacks.
> At least you should check if all argument are !is_c_varname(), !PROBE_ARG_VARS and
> !PROBE_ARG_PARAMS here, instead of checking nargs.
>
>> +
>> +	pr_info("Target program is compiled without optimization. Skipping prologue.\n"
>> +		"Use %s:1 or absolute address 0x%lx to force probe on entry point.\n\n",
> Hmm, is <Function>:1 always available? I think we should just recommend to use only
> the address.
> (moreover, pf->addr may not the absolute address in uprobe event, we'd better say
>   "the address 0x%x")

Nice catch. :)

Sent v2. Please review it.

-Ravi


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ