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: <20201113110125.GD753418@krava>
Date:   Fri, 13 Nov 2020 12:01:25 +0100
From:   Jiri Olsa <jolsa@...hat.com>
To:     Namhyung Kim <namhyung@...nel.org>
Cc:     Jiri Olsa <jolsa@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        lkml <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Ingo Molnar <mingo@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Michael Petlan <mpetlan@...hat.com>,
        Song Liu <songliubraving@...com>,
        Ian Rogers <irogers@...gle.com>,
        Stephane Eranian <eranian@...gle.com>,
        Alexey Budankov <alexey.budankov@...ux.intel.com>,
        Andi Kleen <ak@...ux.intel.com>,
        Adrian Hunter <adrian.hunter@...el.com>
Subject: Re: [PATCH 03/24] perf: Add build id data in mmap2 event

On Fri, Nov 13, 2020 at 01:29:35PM +0900, Namhyung Kim wrote:

SNIP

> >  
> >  	struct {
> >  		struct perf_event_header	header;
> > @@ -7997,13 +8003,23 @@ static void perf_event_mmap_output(struct perf_event *event,
> >  	mmap_event->event_id.pid = perf_event_pid(event, current);
> >  	mmap_event->event_id.tid = perf_event_tid(event, current);
> >  
> > +	if (event->attr.mmap2 && event->attr.build_id)
> > +		mmap_event->event_id.header.misc |= PERF_RECORD_MISC_BUILD_ID;
> > +
> >  	perf_output_put(&handle, mmap_event->event_id);
> >  
> >  	if (event->attr.mmap2) {
> > -		perf_output_put(&handle, mmap_event->maj);
> > -		perf_output_put(&handle, mmap_event->min);
> > -		perf_output_put(&handle, mmap_event->ino);
> > -		perf_output_put(&handle, mmap_event->ino_generation);
> > +		if (event->attr.build_id) {
> > +			u8 size[4] = { (u8) mmap_event->build_id_size, 0, 0, 0 };
> > +
> > +			__output_copy(&handle, mmap_event->build_id, BUILD_ID_SIZE);
> > +			__output_copy(&handle, size, 4);
> > +		} else {
> > +			perf_output_put(&handle, mmap_event->maj);
> > +			perf_output_put(&handle, mmap_event->min);
> > +			perf_output_put(&handle, mmap_event->ino);
> > +			perf_output_put(&handle, mmap_event->ino_generation);
> > +		}
> >  		perf_output_put(&handle, mmap_event->prot);
> >  		perf_output_put(&handle, mmap_event->flags);
> >  	}
> > @@ -8132,6 +8148,11 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
> >  
> >  	mmap_event->event_id.header.size = sizeof(mmap_event->event_id) + size;
> >  
> > +	if (atomic_read(&nr_build_id_events)) {
> > +		build_id_parse_size(vma, mmap_event->build_id,
> > +				    &mmap_event->build_id_size);
> 
> This can fail, right?  Then we need to fallback to use dev/ino..

right, I did not implemented fallback in here, but I think
you are right.. we should try to do the best in fail, I'll add it

thanks,
jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ