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]
Date:   Tue, 19 Jul 2022 13:18:08 +0300
From:   Adrian Hunter <adrian.hunter@...el.com>
To:     Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:     Jiri Olsa <jolsa@...hat.com>, Namhyung Kim <namhyung@...nel.org>,
        Ian Rogers <irogers@...gle.com>,
        Andi Kleen <ak@...ux.intel.com>, linux-kernel@...r.kernel.org,
        kvm@...r.kernel.org
Subject: Re: [PATCH 01/35] perf tools: Fix dso_id inode generation comparison

On 18/07/22 17:57, Arnaldo Carvalho de Melo wrote:
> Em Mon, Jul 11, 2022 at 12:31:44PM +0300, Adrian Hunter escreveu:
>> Synthesized MMAP events have zero ino_generation, so do not compare zero
>> values.
>>
>> Fixes: 0e3149f86b99 ("perf dso: Move dso_id from 'struct map' to 'struct dso'")
>> Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
>> ---
>>  tools/perf/util/dsos.c | 10 ++++++++--
>>  1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/perf/util/dsos.c b/tools/perf/util/dsos.c
>> index b97366f77bbf..839a1f384733 100644
>> --- a/tools/perf/util/dsos.c
>> +++ b/tools/perf/util/dsos.c
>> @@ -23,8 +23,14 @@ static int __dso_id__cmp(struct dso_id *a, struct dso_id *b)
>>  	if (a->ino > b->ino) return -1;
>>  	if (a->ino < b->ino) return 1;
>>  
>> -	if (a->ino_generation > b->ino_generation) return -1;
>> -	if (a->ino_generation < b->ino_generation) return 1;
>> +	/*
>> +	 * Synthesized MMAP events have zero ino_generation, so do not compare
>> +	 * zero values.
>> +	 */
>> +	if (a->ino_generation && b->ino_generation) {
>> +		if (a->ino_generation > b->ino_generation) return -1;
>> +		if (a->ino_generation < b->ino_generation) return 1;
>> +	}
> 
> But comparing didn't harm right? when its !0 now we may have three
> comparisions instead of 2 :-\
> 
> The comment has some value tho, so I'm merging this :-)

Thanks. I found it harmful because the mismatch resulted in a new
dso that did not have a build ID whereas the original dso did have
a build ID.  The build ID was essential because the object was not
found otherwise.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ