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: <4FF71DB5.5050104@gmail.com>
Date:	Fri, 06 Jul 2012 11:17:41 -0600
From:	David Ahern <dsahern@...il.com>
To:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
CC:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
	Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH] perf lock: fix segfault with info subcommand following
 move to libtraceevent

On 7/6/12 11:14 AM, Arnaldo Carvalho de Melo wrote:
> Em Fri, Jul 06, 2012 at 10:02:18AM -0600, David Ahern escreveu:
>> +++ b/tools/perf/builtin-lock.c
>> @@ -877,6 +877,9 @@ static int read_events(void)
>>   	if (!session)
>>   		die("Initializing perf session failed\n");
>>
>> +	if (!perf_session__has_traces(session, "lock record"))
>> +		exit(1);
>> +
>>   	return perf_session__process_events(session, &eops);
>>   }
>
> This is getting out of hand, first a die(), then an exit(1) and finally
> this function returns a value, ouch.
>
> I'd rather use return to signal that something went wrong and as well
> print some helpful warning to the user.
>
> Eventually we should fix all the other offenders, but lets try not to
> add even more.

Agree. But....

>
> Can you please resend with a pr_warning + return failure?


This command needs some love. The rc is not checked and requires some 
rework. e.g., the report path:

     setup_pager();
     select_key();
     read_events();    <---- the function I changed
     sort_result();
     print_result();

and the info path:
         setup_pager();
         read_events();
         dump_info();

I figured for 3.5 at least not segfault; clean up for 3.6 or later.

David
--
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