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: <CALcN6mhzbkG66LPxUbrNF=N7_zA20_qPuaWJkNKocTohB5XQ=w@mail.gmail.com>
Date:   Tue, 11 Apr 2017 11:34:04 -0700
From:   David Carrillo-Cisneros <davidcc@...gle.com>
To:     Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Andi Kleen <ak@...ux.intel.com>, Simon Que <sque@...omium.org>,
        Wang Nan <wangnan0@...wei.com>, Jiri Olsa <jolsa@...nel.org>,
        He Kuang <hekuang@...wei.com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Stephane Eranian <eranian@...gle.com>,
        Paul Turner <pjt@...gle.com>
Subject: Re: [PATCH 6/7] perf tool: protect empty evlists

I did my best to fix those issues in perf inject and perf report, but
yeah, other commands may have issues.

On Tue, Apr 11, 2017 at 11:12 AM, Arnaldo Carvalho de Melo
<acme@...nel.org> wrote:
> Em Mon, Apr 10, 2017 at 01:14:31PM -0700, David Carrillo-Cisneros escreveu:
>> A common pattern in in pipe-mode bugs is accessing an empty evlist.
>> Return NULL to make it easier to catch this problems.
>
> This one is far reaching, we need to take care handling all places using
> these functions, albeit probably most cases will always have an evsel, I
> looked at builtin-top.c for instance, and I think we need to be more
> careful here, will leave this for later.
>
> - Arnaldo
>
>> Signed-off-by: David Carrillo-Cisneros <davidcc@...gle.com>
>> ---
>>  tools/perf/util/evlist.h | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
>> index 39942995f537..ba4788462325 100644
>> --- a/tools/perf/util/evlist.h
>> +++ b/tools/perf/util/evlist.h
>> @@ -257,11 +257,15 @@ void perf_evlist__splice_list_tail(struct perf_evlist *evlist,
>>
>>  static inline struct perf_evsel *perf_evlist__first(struct perf_evlist *evlist)
>>  {
>> +     if (list_empty(&evlist->entries))
>> +             return NULL;
>>       return list_entry(evlist->entries.next, struct perf_evsel, node);
>>  }
>>
>>  static inline struct perf_evsel *perf_evlist__last(struct perf_evlist *evlist)
>>  {
>> +     if (list_empty(&evlist->entries))
>> +             return NULL;
>>       return list_entry(evlist->entries.prev, struct perf_evsel, node);
>>  }
>>
>> --
>> 2.12.2.715.g7642488e1d-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ